【发布时间】:2015-05-23 16:14:08
【问题描述】:
我想更改 OptionMenu 的背景颜色。我使用 ToolBar 并创建了 Theme,但 OptionMenu 的背景颜色没有改变。怎么了?
工具栏
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:theme="@style/Base.ThemeOverlay.AppCompat.Dark"
android:popupTheme="@style/Toolbar_Popup"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:background="@color/ColorPrimary"
android:elevation="2dp"/>
样式
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/ColorPrimary</item>
<item name="colorPrimaryDark">@color/ColorPrimaryDark</item>
</style>
<!-- PopUp theme. -->
<style name="Toolbar_Popup" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:textColorPrimary">#ffffff</item>
<item name="android:background">@color/ColorPrimary</item>
</style></resources>
【问题讨论】:
标签: android colors background toolbar