代码如下:
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);