Reputation: 41
I have a button whose background color I changed with this: android:background="#C0C0C0" and on the emulator, the button is smaller than it was when I didn't have a background color. Is that normal? Thank you.
Upvotes: 0
Views: 68
Reputation: 5661
Yes, it is normal for Button, because the default background image is a nine-patch that defines padding. The padding is added to the size of the text, so when you set the button to just a color, the padding is removed and your button gets smaller.
Upvotes: 1
Reputation: 6709
Add these two to your button element:
android:scaleType="fitXY"
android:padding="0dp"
Upvotes: 0