Can't use android:background with button from the new material components

后端 未结 4 1793
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-18 20:52

I\'m using the new material components com.google.android.material:material with android x but I can\'t set a custom background to the button.

I know that I

4条回答
  •  鱼传尺愫
    2021-02-18 21:40

    Looking at https://medium.com/@velmm/material-button-in-android-e4391a243b17 I found that app:backgroundTint (and app:backgroundTintMode) works. It changes a color, but not a drawable selector.

    Also you can replace with .

提交回复
热议问题