Android - PreferenceActivity - 更改CheckBoxPreference的摘要文本的颜色

rpl*_*orn 11 android android-preferences

我试图更改CheckBoxPreference的摘要文本颜色.我通过指定主题更改了标题的文本颜色,但似乎没有注册摘要部分.这是我的theme.xml文件:

<?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>
Run Code Online (Sandbox Code Playgroud)

我在我的设置活动的onCreate方法中调用它:

setTheme(R.style.settings_theme);
Run Code Online (Sandbox Code Playgroud)

Mar*_*vic 30

将其添加到主题中的style.xml:

<item name="android:textColorSecondary">@color/light_gray</item>
Run Code Online (Sandbox Code Playgroud)