stubbydog
stubbydog

Reputation: 65

Button not wrapping around content

I have a button like this:

<Button
    android:id="@+id/button_down"
    android:layout_width="wrap_content"
    android:layout_height="36dp"
    android:drawableLeft="@drawable/button_down"
    android:background="@color/grey"
    />

But the button isn't wrapping the content:

https://i.sstatic.net/M07UR.png

Notice the massive amount of space to the right of the (faded) icon.

Upvotes: 0

Views: 1126

Answers (1)

N.T.
N.T.

Reputation: 2611

For design and usability reasons, I think there's a default minWidth associated with the button. Add android:minWidth="1dp" and the button is going to be as wide as your text.

Upvotes: 9

Related Questions