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

后端 未结 6 1509
你的背包
你的背包 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 02:54

    To change the colors in the Chip you can use a custom style:

        
    

    With this style:

     
    

    For the chipBackgroundColor you can use a selector like this:

    
    
      
      
      
      
      
      
    
    
    

    For the text color you can use something like:

    
    
      
      
      
      
      
      
    
    
    

    Result for normal/selected state:

提交回复
热议问题