【发布时间】:2012-08-17 10:47:50
【问题描述】:
我正在使用answer 中的代码。
但我没有为我使用的文本视图设置 android:textColor
style="?background_text_color_theme"
必须根据应用程序的主题设置文本颜色(黑色主题为白色文本颜色,反之亦然)。这适用于除 CheckBoxPreference 之外的所有其他地方。
我对我提供的链接所做的更改:
<TextView android:id="@+android:id/title"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee" android:fadingEdge="horizontal"
style="?background_text_color_theme" />
这是我的 style.xml:
<style name="background_text_color_theme_bl">
<item name="android:textColor">#ffffff</item>
</style>
<style name="background_text_color_theme_wh">
<item name="android:textColor">#000000</item>
</style>
Themes.Xml:
<style name="Theme.White" parent="@android:style/Theme.Holo.Light">
<item name="background_text_color_theme">@style/background_text_color_theme_wh</item>
</style>
<style name="Theme.Black" parent="@android:style/Theme.Holo">
<item name="background_text_color_theme">@style/background_text_color_theme_bl</item>
</style>
但是文字颜色好像不是按照样式设置的。谁能告诉我为什么会这样?
谢谢。
【问题讨论】:
标签: android checkbox textcolor preferencescreen