Custom SwitchPreference in Android
How to set a custom style or other background selector drawable for the SwitchPreference widget in Android? (Note: not the regular Switch widget, I mean the standart SwitchPreference widget that used in PreferenceActivity / PreferenceFragment ) Mike You have to create a custom layout for the switch itself and you can apply it dynamically like. preference.setWidgetLayoutResource(R.layout.custom_switch); But I'll go into details and show you exactly how to achieve this. So, you define your preference in an xml file like preferences.xml <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen