Alessandro Roaro
Alessandro Roaro

Reputation: 4733

How to remove extra space in button when using drawable

I have a Button with no text and with a drawable on the right of it added through setCompoundDrawablesWithIntrinsicBounds. On the left, though, there is some unused space which I would like to remove. Is there a way to do that? The only way I have found to fix this in some way is setting the padding of the button in order to center the drawable.

Upvotes: 1

Views: 488

Answers (1)

Cechinel
Cechinel

Reputation: 707

If you won't use text, you should use ImageButton instead.

Just set setBackgroundDrawable and be happy ^^

Upvotes: 1

Related Questions