代码如下:
Drawable leftDrawable = getResources().getDrawable(R.mipmap.ic_launcher);
//要加这行!
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
textView2.setCompoundDrawables(leftDrawable ,null,null,null);
代码如下:
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
网友评论