How to change the track color of a SwitchCompat

I had same probrem and solved it. <style name=”AppTheme” parent=”Theme.AppCompat.Light.NoActionBar”> … <!– Active thumb color & Active track color(30% transparency) –> <item name=”colorControlActivated”>@color/theme</item> <!– Inactive thumb color –> <item name=”colorSwitchThumbNormal”>@color/grey300</item> <!– Inactive track color(30% transparency) –> <item name=”android:colorForeground”>@color/grey600</item> … </style> I read app compat code, and understand it. android.support.v7.internal.widget.TintManager.java private ColorStateList getSwitchTrackColorStateList() { if (mSwitchTrackStateList … Read more