所以我试图设置操作栏溢出菜单的样式但是根本没有运气。出于某种原因,我试图应用的风格(白色背景)就像在某个地方完全被覆盖一样。有什么想法吗?
<style name="AppTheme" parent="android:Theme.DeviceDefault.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="android:editTextStyle">@style/App.EditText</item>
<item name="android:textColor">@color/night</item>
<item name="android:listPopupWindowStyle">@style/ListPopupWindow</item>
</style>
<style name="PopupMenu" parent="android:Widget.ListPopupWindow">
<item name="android:popupBackground">@color/white</item>
</style>
答案 0 :(得分:1)
找到解决方案,
希望这会有所帮助。
http://daniel-codes.blogspot.com/2012/11/the-unknown-style-actionbarwidgettheme.html
基本上你需要为android:actionBarWidgetTheme
生成一个新的主题(样式),它将用于充气,以根据需要正确设置菜单项的样式。
<item name="android:actionBarWidgetTheme">@style/ActionBarWidgetTheme</item>
<style name="ActionBarWidgetTheme" parent="android:Theme.DeviceDefault.Light.DarkActionBar">
<item name="android:popupMenuStyle">@style/PopupMenu</item>
<item name="android:dropDownListViewStyle">@style/DropDownListView</item>
</style>
答案 1 :(得分:0)
试试这个
<style name="YOUR_DARK_AB_THEME">
<item name="android:actionBarWidgetTheme">@style/YourActionBarWidget</item>
</style>
<!-- This helps the PopupMenu stick with Light theme while the ActionBar is in Dark theme -->
<style name="YourActionBarWidget"
parent="android:Theme.Holo.Light">
<item name="android:popupMenuStyle">@android:style/Widget.Holo.Light.PopupMenu</item>
<item name="android:dropDownListViewStyle">@android:style/Widget.Holo.Light.ListView.DropDown</item>
</style>
答案 2 :(得分:0)
您可以使用以下行更改OverFlow菜单的背景..
<style name="AppTheme" parent="android:Theme.Light">
<item name="android:popupMenuStyle">@style/PopupMenu</item>
</style>
<style name="PopupMenu" parent="@android:style/Widget.PopupMenu">
<item name="android:popupBackground">@android:color/black</item>
</style>
希望它会帮助你..