【问题标题】:Android - How to change text color of action tab menu?Android - 如何更改操作选项卡菜单的文本颜色?
【发布时间】:2014-04-08 10:34:36
【问题描述】:

我正在尝试使用一些自定义颜色调整我的应用,但我无法更改操作栏的文本颜色。

这是它目前的显示方式:

如果您仔细观察,您可能会在白色标签栏中看到字母。我正在尝试将此颜色更改为黑色而不更改操作栏的任何其他内容。

这就是我的 styles.xml 的样子:

<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
    <item name="android:actionBarStyle">@style/ActionBar</item>
</style>

<style name="ActionBar" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
    <item name="android:background">@color/default_green</item>
    <item name="android:backgroundStacked">@color/stacked_white</item>
    <item name="android:backgroundSplit">@color/sa_green</item>
</style>

感谢任何帮助。

【问题讨论】:

标签: android android-layout


【解决方案1】:

您可以在这里制作自定义主题:

http://jgilfelt.github.io/android-actionbarstylegenerator/

其中包括所有选项卡和其他组件。

【讨论】:

  • 只是一个快速的解决方案会很好,而不是实现一个全新的样式。如果没有更好的建议,我会这样做。
【解决方案2】:

试试这个... 这应该在主题中

<item name="actionBarTabTextStyle">@style/tabtextcolor</item>
<item name="android:actionBarTabTextStyle">@style/tabtextcolor</item>

这应该是您定义选项卡文本颜色的地方。

<style name="tabtextcolor" parent="@style/Widget.Sherlock.ActionBar.TabText">
    <item name="android:textColor">@android:color/white</item>
</style>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-14
    • 2021-04-29
    • 2011-04-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多