How to change the track color of a SwitchCompat

后端 未结 10 1840
孤城傲影
孤城傲影 2020-11-29 18:01

I\'ve tried using the following link to change the color of a SwitchCompat:

How to change the color of a SwitchCompat

Notice the low constrast in my switch:<

10条回答
  •  迷失自我
    2020-11-29 18:31

    if you want to costumize the color of track.you can use this solution.

    track selector.xml

     
       
        
        
        
        
    

    where checked_color and unchecked_color are color of your choices.

    styles.xml

    
    
    
    
    

    layout file

    
    

提交回复
热议问题