溢出菜单项文本

时间:2014-01-28 20:45:59

标签: android drop-down-menu menuitem menubar android-styles

我经历了足够的样本并尝试了整整两天的许多组合,我错过了掌握一些东西。请纠正我......

我想更改溢出菜单中存在的菜单项文本的颜色。

谢谢

我的样式文件

<resources xmlns:android="http://schemas.android.com/apk/res/android">

    <!-- Application theme. -->
    <style name="AppTheme" parent="@android:style/Theme.Holo.Light">
        <item name="android:actionBarStyle">@style/ActionBarTheme</item>
        <item name="android:popupMenuStyle">@style/PopupMenuTheme</item>
        <item name="android:actionMenuTextColor">@android:color/white</item>
        <item name="android:actionOverflowButtonStyle">@style/MenuButtonTheme</item>
    </style>

    <!-- action bar -->
    <style name="ActionBarTheme" parent="@android:Widget.Holo.Light.ActionBar">
        <item name="android:background">@color/SmugeBlue</item>
        <item name="android:titleTextStyle">@style/ActionBarTitle</item>
    </style>
    <!-- action bar title -->
    <style name="ActionBarTitle" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title.Inverse">
        <item name="android:textColor">@android:color/white</item>
    </style>

    <!-- pop up menu background color -->
    <style name="PopupMenuTheme" parent="@android:style/Widget.Holo.Light.ListPopupWindow">
        <item name="android:popupBackground">@color/SmugeBlue</item>
        <item name="android:textStyle">@style/MenuText</item>
    </style>

    <style name="MenuText">
        <item name="android:textColor">@android:color/white</item>
    </style>

    <style name="MenuButtonTheme" parent="@android:style/Widget.Holo.ActionButton.Overflow">
        <item name="android:src">@drawable/overflow_menu_button</item>
    </style>

</resources>

enter image description here

----用解决方案更新我发现我的案例很方便

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

0 个答案:

没有答案