How to have a Lollipop switch button

后端 未结 7 1272
暖寄归人
暖寄归人 2021-02-04 02:05

I want to have the Lollipop style switch button for my app:

\"enter

How could I im

7条回答
  •  猫巷女王i
    2021-02-04 02:51

    At first set android:targetSdkVersion="22" in your manifest to make your app compatible to Lollipop.

    NOTE: Color of your switch depends on this

    @color/accent
    

    Create your own theme for your app in styles.xml in Folder values-v21

    
    
        
    
    

    styles.xml in default Folder values or values-v14

    
    
        
        
    
        
    
    
    

提交回复
热议问题