setCompoundDrawables() doesn’t display the Button Drawable

Standard

Image is blank because it hasn’t got specified bounds. You may use setCompoundDrawables() but before you should specify image’s bounds, using Drawable.setBounds() method:

Drawable d = getResources().getDrawable(R.drawable.ic_action_selector);
d.setBounds(0, 0, 128, 128);
btnRegistery.setCompoundDrawables(null, d, null, null);

Leave a Reply

Your email address will not be published. Required fields are marked *