Drawable drawable=context.getResources().getDrawable(R.mipmap.spgz); drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight()); button(控件名).setCompoundDrawables(null, drawable, null, null);
//setCompoundDrawables(左,上,右,下);
Drawable drawable=context.getResources().getDrawable(R.mipmap.spgz); drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight()); button(控件名).setCompoundDrawables(null, drawable, null, null);
//setCompoundDrawables(左,上,右,下);