[英]How to change drop down menu background color for AppCompat theme?
I try to change drop-down menu background, but can't find right decision.我尝试更改下拉菜单背景,但找不到正确的决定。 http://i.stack.imgur.com/OqO4j.png
http://i.stack.imgur.com/OqO4j.png
That is ../values-v21/styles.xml I used那是我用的 ../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>
Explain, please, how I can change background color there.请解释一下,我如何在那里更改背景颜色。
Since you are using a Toolbar you can use something like this:由于您使用的是工具栏,因此您可以使用以下内容:
<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"
...../>
where popupTheme is: popupTheme 在哪里:
<style name="popupTheme" parent="ThemeOverlay.AppCompat.Light">
<item name="android:textColorPrimary">@color/myTextColor</item>
<item name="android:colorBackground">@color/myPopupBackgroundColor</item>
</style>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.