黑暗的动作条与河洛浅白色的下拉菜单浅白、菜单、黑暗、动作

2023-09-12 02:05:25 作者:听雨後的天空,有一點迷蒙

我有一个自定义主题与父母@android:款式/ Theme.Holo.Light.DarkActionBar 我想改变下拉菜单进入白色版本(见图片)

I've got an custom theme with a parent @android:style/Theme.Holo.Light.DarkActionBar I want to change the dropdown menu into the white version (see image)

我已经看过了一些例子,但他们没有工作对我来说,是有可能只覆盖从DarkActionBar下拉菜单的简易版本?

I have looked up some examples, but they didn't work out for me, is it possible to just override the dropdown menu from the DarkActionBar with the light version?

(我不使用大侦探动作条)

(I dont use the sherlock actionbar)

推荐答案

这为我工作。希望这有助于:

This worked for me. Hope it help:

<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>