Android, setting background color of button loses ripple effect

后端 未结 7 1041
北恋
北恋 2020-12-07 00:40

After adding color to an android button, it loses its ripple effect that makes the user feel like there is a responsive click. How do I fix this? I\'ve searched through many

7条回答
  •  有刺的猬
    2020-12-07 00:59

    Don't change the background of Button. Change the theme.

    
    

    and in your xml file

    Or you can add it in your main app theme

    
    

    And don't need change button background.

    If you want totally custom background you need create your selector. And you can set there ripple effect.

提交回复
热议问题