【发布时间】:2015-01-08 08:16:08
【问题描述】:
我正在使用 v7 appcompat 21 库在棒棒糖之前的设备上使用新的 Material 样式。我的styles.xml 看起来像这样:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:textColorPrimary">#ff0000</item>
<item name="android:textColorPrimaryInverse">#ff0000</item>
</style>
我正在尝试更改操作栏上的文本颜色。但无论我为 textColorPrimary 或 textColorPrimaryInverse 放置什么,颜色始终是白色的。如果我从 Theme.AppCompat 继承,我可以覆盖“textColorPrimary”,如果我从 Theme.AppCompat.Light 继承,我可以覆盖“textColorPrimaryInverse”。但是在使用 Light.DarkActionBar 主题时两者都不起作用。
我肯定会使用 AppTheme,因为设置诸如 colorPrimary 之类的属性来更改操作栏背景颜色可以正常工作。我没有使用任何其他资源限定符样式文件。
我已经翻阅了 android 样式文件,但似乎无法确定要覆盖的属性。有任何想法吗?这是一个 appcompat 错误吗?
【问题讨论】:
标签: android android-actionbar android-appcompat android-actionbar-compat material-design