Android, setting background color of button loses ripple effect

后端 未结 7 1117
北恋
北恋 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:54

    Just use :

    android:backgroundTint="#4CAF50"
    

    Instead of:

    android:background="#4CAF50"
    

    Don't forget to change your Button to android.support.v7.widget.AppCompatButton

提交回复
热议问题