What is the difference between setting a drawable via xml like
android:drawableRight="@drawable/arrow_right_normal"
and setting a drawable via code like
bt.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, R.drawable.arrow_right_normal);
Because in the first case everything works like expected (Buttontext is center horizantal and the icon is in the middle of the right side). And in the second case the icon is at the bottom/middle of the Button and the Text is at the top left side.
right
is the third parameter. The last one is bottom
bt.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.arrow_right_normal,0);
Here the documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With