The textColor attribute isn't working. Here's my XML:
<PreferenceCategory
android:title="Title"
android:textColor="#00FF00">
Any ideas?
The textColor attribute isn't working. Here's my XML:
<PreferenceCategory
android:title="Title"
android:textColor="#00FF00">
Any ideas?
Other way around will be mention the theme in your AppTheme, application level
XML : pref_category_view
For more customization visit v7 Preferences res
Important: I am using PreferenceFragmentCompat from lib v7 Preference.
One solution is to make a theme for your PreferenceScreen. So in your themes.xml or styles.xml (better to put it in themes.xml) :
then in your AndroidManifest.xml :
It worked perfectly for me.
And in your prefs.xml:
Or you can also use this answer
Define your own PreferenceTheme and override colors.
A lot of the other answers didn't work for my case. I'm using a PreferenceFragmentCompat and I didn't want to have actual code doing this. So I simply made a copy of the preference category xml file and changed the textColor field. The file goes under the Apache license, Version 2.
And imported it in my .xml layout for the Preference fragment:
To change text color of preference category only set a theme to your
PreferenceActivity
in your Android Manifest and make sure that colorAccent item exists. This color is taken by yourPreferenceCategory
.