我有主题 Holo.Light.DarkActionBar
选项卡现在设置为白色背景、浅灰色文本——非常难读。我只是想将文本更改为更暗的内容。
我已经搜索了样式以查看是否可以覆盖,但我所能做的就是更改背景,而不是文本。
我可以在 styles.xml 中执行此操作还是必须以编程方式执行此操作?
最佳答案
如果您指的是 ActionBar
的选项卡,请查看这是否改变了颜色:
<!-- The theme for the activity -->
<style name="TabSpecialTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<item name="@android:attr/actionBarTabTextStyle">@style/TabStyle</item>
</style>
<!-- Modify the text color -->
<style name="TabStyle" parent="android:Widget.Holo.Light.ActionBar.TabText.Inverse">
<item name="android:textColor">#F70000</item>
</style>
当然不要忘记在 list 中将 Activity 的主题设置为 @style/TabSpecialTheme
。
关于ActionBar/Tabs 中的 Android 自定义主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11564378/