using a custom color for button background while using selectableItemBackground attribute

后端 未结 6 2170
伪装坚强ぢ
伪装坚强ぢ 2021-02-06 21:37

I am trying to use

android:background=\"?android:attr/selectableItemBackground\"

to get my button to do appropriate effects for each android versi

6条回答
  •  清酒与你
    2021-02-06 22:21

    Instead of using ?android:attr/selectableItemBackground you can create a xml in drawable in folder with following content.

    
      
      
          
    
    

    Updated: so you save this files as btn_drawable.xml in drawable folder.

    Simply replace ?android:attr/selectableItemBackground with @drawable/btn_drawable.xml

提交回复
热议问题