我正在使用Android工具栏。我只想改变溢出菜单的背景颜色。但是它没有改变。
样式XML
<style name="MyDarkToolbarStyle" parent="Widget.AppCompat.Toolbar">
<item name="popupTheme">@style/PopupMenuStyle</item>
<item name="theme">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
</style>
<style name="PopupMenuStyle" parent="android:Widget.Holo.Light.PopupMenu">
<item name="android:popupBackground">@android:color/white</item>
</style>
工具栏 XML
<android.support.v7.widget.Toolbar
android:id="@+id/tool_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/ColorPrimary"
android:elevation="2dp"
android:theme="@style/MyDarkToolbarStyle" />
app:popupTheme
,不是android:popupTheme
。 - user25android:colorBackground
没有起作用,但是android:background
起了作用。 - Taylor