Reputation: 1813
I am trying to change the color of the text and the background of the preference categories. I searched the webs for answers, but nothing seems to be working. Has anyone successfully changed the color of the preference category attributes? Could I use a custom layout to change looks and feel of the preference category? I need some more direction. Please help
Here is what I have so far:
<style name="Theme" parent="@style/android:Theme.Holo.Light">
<item name="android:actionBarStyle">@style/ActionBar</item>
</style>
<style name="ActionBar" parent="@android:style/Widget.Holo.Light.ActionBar.Solid">
<item name="android:background">@color/ab_grey</item>
</style>
<style name="PrefCatStyle" parent="Theme">
<item name="android:textColor">@color/text_green</item>
<item name="android:background">@color/pref_back</item>
</style>
colors
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ab_grey">#adadad</color> <!-- #adadad-->
<color name="text_green">#000000</color>
<color name="pref_back">#FFFFFF</color>
</resources>
Part of my Preference Layout
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:title="Settings"
android:key="settings_category"
style="@style/PrefCatStyle">
And my part Manifest
<application
android:allowBackup="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/Theme" >
...
<activity
android:name=".SettingsPrefActivity"
android:parentActivityName=".MainActivity"
android:theme="@style/emTextTheme">
Thanks
Upvotes: 7
Views: 26660
Reputation: 258
yes. you can use custom layout. take a look at the answer of this question. Custom PreferenceCategory Headings
Upvotes: 5