2013-04-03 35 views
11

我试图更改CheckBoxPreference的摘要文本颜色。我已通过指定主题更改了标题的文字颜色,但它似乎并未注册摘要部分。这里是我的theme.xml文件:Android - PreferenceActivity - 更改CheckBoxPreference的摘要文本的颜色

<?xml version="1.0" encoding="UTF-8"?> 
<resources xmlns:android="http://schemas.android.com/apk/res/android"> 
    <style name="settings_theme" parent="android:Theme.Light"> 
     <item name="android:textColor">@color/light_gray</item> 
    </style> 
</resources> 

而且我打电话这在我的设置活动的onCreate方法:

setTheme(R.style.settings_theme); 

回答

28

一下添加到style.xml在你的主题:

<item name="android:textColorSecondary">@color/light_gray</item> 
+0

最好的和我见过的最多的解决方案 –