在代码中给textview设置drawableRight

Drawable drawable = getResources().getDrawable(R.mipmap.icon_expand_view);
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight()); //设置边界
mTvExpand.setCompoundDrawables(null, null, drawable, null);

直接通过mTvExpand.setCompoundDrawables(null, null, drawable, null);是没效果的,必须像上面这样设置

发布了89 篇原创文章 · 获赞 33 · 访问量 9万+

猜你喜欢

转载自blog.csdn.net/chenli_001/article/details/84790351