switchcompat

How to change the color of a SwitchCompat from AppCompat library [duplicate]

这一生的挚爱 提交于 2019-11-26 06:53:50
问题 This question already has answers here : Change “on” color of a Switch (17 answers) Closed 9 months ago . I have a few switch controls with different colors in my application and to change their colors I used multiple custom drawable selectors. A new android.support.v7.widget.SwitchCompat control was introduced with the release of the AppCompat v21 library. Is it possible to change the color of a SwitchCompat programmatically without customer drawable selector, but with XML or code? 回答1: