On/Off Toggle Button in Preferences & Action Bar - Ice Cream Sandwich Style

后端 未结 1 2058
醉话见心
醉话见心 2021-02-07 11:00

I am referring to the blue ON/OFF styling as seen in the default Android Settings app on ICS phones. It can also be seen here: http://android-developers.blogspot.com/2012/02/and

相关标签:
1条回答
  • 2021-02-07 11:58

    As easy as:
    My xml-v14/preferences.xml

    <SwitchPreference
        android:key="@string/feature_id"
        android:title="@string/feature_title" />
    

    For compatibility:
    My xml/preferences.xml

    <CheckBoxPreference 
        android:key="@string/feature_id"
        android:title="@string/feature_title" />
    
    0 讨论(0)
提交回复
热议问题