当使用PreferenceFragmentCompat时,我该如何设置文本颜色?

3

我正在覆盖来自v7支持库的PreferenceFragmentCompat类,以提供应用程序中的设置屏幕。我需要设置PreferenceScreen中项目的文本颜色。

这是我尝试过的方法(在styles.xml中)-

<style name="AppTheme.Preference" parent="@style/PreferenceThemeOverlay">
    <item name="android:textColor">@android:color/holo_red_dark</item>
</style>

<style name="AppTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="preferenceTheme">@style/AppTheme.Preference</item>
</style>

但这并不改变颜色。我该如何设置偏好屏幕文本颜色?
1个回答

5

我通过使用android:textColorPrimary而不是android:textColor来解决了这个问题。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接