如何更改 Lollipop 之前和 Lollipop 版本的工具栏菜单项文本颜色

How to change toolbar menu item text color for pre Lollipop and Lollipop versions

我使用工具栏是为了 material 在我的应用程序中进行设计。一切正常,但除了更改菜单项文本颜色时,我完全无法接受该解决方案。我还张贴了我在申请中使用的文本和代码的屏幕截图,供您参考。我尝试了几种替代方法,例如分配如下

<item name="android:actionMenuTextColor">@color/white</item>

<item name="android:textColor">#000</item>

但已知上述解决方案对我有用。

要求截图:

需要将 SKIP 菜单项从黑色更改为白色。

styles.xml

<style name="ToolBarTheme" parent="@style/Theme.AppCompat.Light">
        <item name="colorPrimary">@color/blue</item>
        <item name="colorPrimaryDark">@color/blue</item>
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
        <item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
        <item name="android:actionMenuTextColor">@color/white</item>
        <item name="android:textColor">#000</item>

    </style>

toolbar.xml

<android.support.v7.widget.Toolbar
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
    app:layout_scrollFlags="scroll|enterAlways"
    android:fitsSystemWindows="true"
    android:background="?attr/colorPrimary"/>

清单

<activity
            android:name=".activity.HomeActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:configChanges="keyboard|screenLayout|orientation"
            android:theme="@style/ToolBarTheme"></activity>

真不知道自己错在哪里了。请帮我。提前致谢

改变这个

<item name="android:actionMenuTextColor">@color/white</item>

<item name="actionMenuTextColor">@color/white</item>

并将主题应用到工具栏:

android:theme="@style/ToolBarTheme"

您为您的小部件设计样式并为您的 activity 提供主题。