If you want to define the accuracy size of the drawable, You should use Java code instead of android:drawableLeft
Drawable dw = getResources().getDrawable(R.drawable.ic);
dw.setBounds(0, 0, 100, 100); // set the size of the drawable to 100*100
button.setCompoundDrawables(dw, null, null, null);
because of
android:drawableLeft // equals with setCompoundDrawablesWithIntrinsicBounds
and
android:drawablePadding // this used to control the padding between the text and drawable
.
stackoverflow.comm
No comments:
Post a Comment