我尝试更改下拉菜单的背景,但找不到正确的决定。 http://i.stack.imgur.com/OqO4j.png
即我使用的../ values-v21 / styles.xml
<style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="colorPrimary">#009688</item>
<item name="colorPrimaryDark">#00796B</item>
<item name="android:textColorPrimary">#FFFFFF</item>
</style>
请解释,我该如何更改背景颜色。
由于您正在使用工具栏,因此可以使用类似以下的内容:
<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/action_bar_main"
app:popupTheme="@style/popupTheme"
...../>
其中popupTheme是:
<style name="popupTheme" parent="ThemeOverlay.AppCompat.Light">
<item name="android:textColorPrimary">@color/myTextColor</item>
<item name="android:colorBackground">@color/myPopupBackgroundColor</item>
</style>