How do I just change the text color of checkbox views in Android Studio's styles.xml?
I want to create a theme where all checkbox items are a color different from the default black like:
Except I want the box itself to be the same color as the text.
Should I be using the following in my theme?
@style/App_CheckboxStyle
解决方案
I know that this question is asked long time ago but I want to add my solution. It works with all SDK versions.
You are right that in order to change CheckBox style in the whole project, you have to add the line to your theme:
...
@style/MyCheckBoxStyle
...
And the style itself, where you set your custom text and checkbox color:
@android:color/holo_purple
@android:color/holo_purple
Note: android: prefix indicates that a property is linked to SDK attributes. If you remove it, the property links to support library. That's why system treats buttonTint and android:buttonTint as different parameters. If your minimum SDK is 21, you don't need to use support library and you can simply use android:buttonTint.