0

I changed the style of a button using the following style

<style name="MyButtonStyle" parent="android:Widget.Holo.Button">
    <item name="android:background">@color/bg_color</item>
    <item name="android:textStyle">bold</item>
    <item name="android:textSize">22sp</item>
</style>

the style was applied successfully as I wanted, but now when I click the button the blue overlay of the pressed state is no longer shown, how can I recover it?

1 Answers1

0

you are setting custom background for button and it is solid color, without state. This blue overlay comes from nine-patches of button

You should use selector as here or even better: button drawable generator

Community
  • 1
  • 1
snachmsm
  • 17,866
  • 3
  • 32
  • 74