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
)
Create a style in your style.xml file and give it Widget.AppCompat.CompoundButton.Switch parent.
Then you can use the link below to complete your theme
How to change the track color of a SwitchCompat