Skip to content Skip to sidebar Skip to footer

Dark Actionbar With White Dropdown Menu From Holo Light

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) I have looked up some ex

Solution 1:

This worked for me. Hope it help:

<stylename="YOUR_DARK_AB_THEME"><itemname="android:actionBarWidgetTheme">@style/YourActionBarWidget</item></style><!-- This helps the PopupMenu stick with Light theme while the ActionBar is in Dark theme --><stylename="YourActionBarWidget"parent="android:Theme.Holo.Light"><itemname="android:popupMenuStyle">@android:style/Widget.Holo.Light.PopupMenu</item><itemname="android:dropDownListViewStyle">@android:style/Widget.Holo.Light.ListView.DropDown</item></style>

Solution 2:

use the same context of actionBar to create the PopupMenu

actionBar.getThemedContext()

So,

ActionBar actionBar = ((ActionBarActivity) getActivity()).getSupportActionBar(); PopupMenu popMenu = new PopupMenu(actionBar.getThemedContext(), anyView);

Post a Comment for "Dark Actionbar With White Dropdown Menu From Holo Light"