美文网首页
Android 代码动态设置TextView的drawable

Android 代码动态设置TextView的drawable

作者: 背锅TV丶伴奏大师 | 来源:发表于2022-05-20 16:34 被阅读0次
Drawable drawableUp=mContext.getResources().getDrawable(R.drawable.ic_arrow_up_coupon);
//tv_rule.setCompoundDrawables(null,null,drawableUp,null);//点击后会消失不见,不建议用
//设置文字右边的图片,
tv_rule.setCompoundDrawablesWithIntrinsicBounds(null,null,drawableUp,null);

相关文章

网友评论

      本文标题:Android 代码动态设置TextView的drawable

      本文链接:https://www.haomeiwen.com/subject/iuifprtx.html