android - how can i change the color of ListPreference title? -


my xml code this:

 <preferencecategory android:title="title">         <listpreference                      android:title="@string/pref_theme"                     android:entryvalues="@array/pref_theme_values"                     android:entries="@array/pref_theme_entries"                                  android:key="theme">         </listpreference>     </preferencecategory> 

how can change color of title here? new android

create prefernce style in style.xml file , define primary secondary , tertiary colors there.

for example:

<style name="settingsfragmentstyle">      <item name="colorprimary">@color/toolbar_color</item>     <item name="colorprimarydark">@color/toolbar_color_dark</item>     <item name="android:textcolorprimary">@color/toolbar_color_dark</item>     <item name="android:textcolorsecondary">@color/toolbar_color_dark</item>     <item name="android:textcolortertiary">@color/toolbar_color_dark</item>     <item name="android:background">@color/white</item>     ... </style> 

then add preference theme in current apptheme, this:

<style name="apptheme" parent="appbasetheme">      <!-- other themes -->     <item name="preferencetheme">@style/settingsfragmentstyle</item>  </style> 

i hope helps.


Popular posts from this blog