2

When you set android:background to another color, the Button appears more bigger. Also, the lines surrounding the Button is gone. Why is this?

so5user5
  • 325
  • 1
  • 16

1 Answers1

1

When you set color it draws rectangle area by this color but default it can use some drawable or nine patch picture. Use shape to customize background or override styles. If you need to apply style only for some view you can use xml attribute style.

<style name="MyCoolStyle" parent="base style of view" >
</style>

In layout xml:

<YourView
   style="@style/MyCoolStyle"/>
Denis Sologub
  • 7,277
  • 11
  • 56
  • 123