Drawable drawableLeft= getResources().getDrawable(R.drawable.button_yjt);
drawableLeft.setBounds( 0, 0,drawableLeft.getMinimumWidth(),drawableLeft.getMinimumHeight());//避免图标变形btn1.setCompoundDrawables(null, null, drawableLeft, null);
Drawable drawableLeft= getResources().getDrawable(R.drawable.button_yjt);
drawableLeft.setBounds( 0, 0,drawableLeft.getMinimumWidth(),drawableLeft.getMinimumHeight());//避免图标变形btn1.setCompoundDrawables(null, null, drawableLeft, null);