Set com.google.android.material.chip.Chip selected color

后端 未结 6 1542
你的背包
你的背包 2021-02-01 02:42

How do I set the selected com.google.android.material.chip.Chip color? I don\'t want it to be the default gray. This is a single selection chip group.

Original

6条回答
  •  忘掉有多难
    2021-02-01 03:17

    Just set an attribute app:chipBackgroundColor and pass a color state list to it:

    
    

    bg_chip_state_list looks like this:

    
    
        
        
    
    

    However I also had to set android:clickable to true to make this work

提交回复
热议问题