如何将主题/样式应用于ActionMenuView?

时间:2014-11-07 22:56:15

标签: android android-theme android-toolbar

我使用新的android.support.v7.widget.ActionMenuView(v7,r21)来模仿我的应用中的分割操作栏。我的顶部工具栏以ThemeOverlay.AppCompat.Dark.ActionBar为主题,因此其文本和溢出图标显示为白色。但是,ActionMenuView内容显示为黑色,有没有办法在那里应用主题,或者至少将选项项目的颜色设置为白色?

<android.support.v7.widget.Toolbar
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:support="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:id="@+id/bar_action"
    android:background="?attr/colorPrimary"
    support:popupTheme="@style/ThemeOverlay.AppCompat.Light"
    support:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />

<android.support.v7.widget.ActionMenuView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:id="@+id/bar_split"
    android:background="?attr/colorPrimary" />

1 个答案:

答案 0 :(得分:0)

愚蠢的我,没有在我的主题中定义android:textColorPrimary

相关问题