4

I am creating an application for android 4.0 tablet with a certain color scheme. I am using Theme.Holo for my activities. I am using Theme.Holo.Light for my PreferenceActivity. I have been able to customize the action bar using styles. I create preference header list using onBuildHeaders method and group different preferences into fragments (much like the android system Settings). I also want to change the color of header list elements to match my application color scheme but I haven't been able to figure out how. Please click on the link to see my preference activity.

Is it possible to change this color scheme and how?

Khurram
  • 41
  • 1
  • 3
  • possible duplicate: http://stackoverflow.com/questions/3551169/change-background-color-of-preference?rq=1 – baronS May 02 '13 at 17:12

1 Answers1

1

Preference headers use the listViewStyle xml attribute to determine it's style. If you'd like to customize that, then override that setting with your own style. Eg:

themes.xml

<style name="Theme.Custom" parent="android:Theme.Holo.Light.DarkActionBar">
    <item name="android:listViewStyle">@style/MyListViewStyle</item>
</style>

styles.xml

<style name="MyListViewStyle" parent="@android:style/Widget.Holo.Light.ListView">
    <item name="android:background">@color/custom_color</item>
    <item name="android:listSelector">@drawable/my_selector</item> 
</style>
Ifrit
  • 6,791
  • 8
  • 50
  • 79