更改首选项标题的文本颜色 [英] Changing the text color of preference header
问题描述
我的整体主题是使用 Theme.AppCompat.Light
。当选择左侧的项目时,文本颜色变为白色,这很难看到背景的浅色。我想防止这种颜色变化,并保持为黑色。任何人都知道如何做到这一点?
my overall theme is using the Theme.AppCompat.Light
. When an item on the left side is selected, the text color turns WHITE, which is hard to see against the light background. I want to prevent this color change and keep it as black. Anyone know how to do this?
我尝试更改listSelector样式,但只更改背景颜色。我需要更改前景文本颜色。感谢。
I tried changing listSelector styling, but that only changes the background color. I need to change the foreground text color. Thanks.
>
推荐答案
< item name =android:activatedBackgroundIndicator> @ drawable / activated_background_settings< / item> code>
<item name="android:activatedBackgroundIndicator">@drawable/activated_background_settings</item>
这应该可以解决问题。在这种情况下,它引用的drawable是一个选择器
That should solve the problem. The drawable that it is referencing is a selector in this case
这篇关于更改首选项标题的文本颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!