美文网首页
动态设置textview的drawableleft...

动态设置textview的drawableleft...

作者: Jannonx | 来源:发表于2019-06-17 17:15 被阅读0次

代码如下:

Drawable leftDrawable = getResources().getDrawable(R.mipmap.ic_launcher);
//要加这行!
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
textView2.setCompoundDrawables(leftDrawable ,null,null,null);

相关文章

网友评论

      本文标题:动态设置textview的drawableleft...

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