项目催的紧,轻信百度导致被坑了(网上全都是这行代码
),根本行不通!!!!为textview动态设置drawableleft、drawableright、drawabletop、drawablebottom的正确姿势是:
Drawable drawable = getResources().getDrawable(R.mipmap.ic_launcher);
//一定要加这行!!!!!!!!!!! drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight()); textView2.setCompoundDrawables(drawable,null,null,null);