我正在使用最新版本的支持库 (V21),其中包括 Material 主题(在 Theme.AppCompat 名称下),我想将 ActionBar 标题设置为白色。我试图通过在我的自定义主题中使用 textColorPrimary(如图所示 there)属性来实现它
<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light">
<item name="colorPrimary">@color/orange</item>
<item name="colorPrimaryDark">@color/orange_dark</item>
<item name="colorAccent">@color/white</item>
<!-- This attribut set text color -->
<item name="android:textColorPrimary">@color/white</item>
</style>
有了这个,我得到了一个白色的操作栏标题但所有其他文本(textview、edittext)也是白色的......
有没有办法只改变最近发布的功能的操作栏标题颜色,或者唯一的方法是为操作栏使用自定义样式,就像 Holo 的情况一样?
最佳答案
使用 @style/Theme.AppCompat.Light.DarkActionBar
仅在 Action Bar 中反转文本颜色。
关于android - 更改 ActionBarCompat 标题颜色但不更改其他文本颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26617239/