在ActionBar上更改菜单字体的颜色

时间:2015-05-20 11:23:37

标签: android

我希望更改菜单字体的颜色:

<!-- Base application theme. -->
<style name="AppTheme" parent="@android:style/Theme.Holo.Light">
    <item name="android:actionBarStyle">@style/MyActionBar</item>
</style>

<!-- ActionBar styles -->
<style name="MyActionBar"
    parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
    <item name="android:background">@color/dark_gray</item>
    <item name="android:color">@android:color/white</item>
    <item name="actionMenuTextColor">@android:color/white</item>
    <item name="android:actionMenuTextColor">@android:color/white</item>
</style>

但菜单字体颜色仍为黑色。我应该添加/删除哪个项目?

enter image description here

2 个答案:

答案 0 :(得分:2)

试试这个

<style name="AppTheme" parent="@android:style/Theme.Holo.Light">
    <item name="actionMenuTextColor">@color/white</item>
    <item name="android:actionMenuTextColor">@color/white</item>
</style>

答案 1 :(得分:0)

使用此样式

<style name="MyTheme" parent="Theme.Sherlock.ForceOverflow">
    <item name="android:actionBarWidgetTheme">@style/MyActionWidgetTheme</item>
    <item name="actionBarWidgetTheme">@style/MyActionWidgetTheme</item>
</style>

<style name="MyActionWidgetTheme" parent="Widget">
    <item name="android:textColor">#f00</item>
</style>