So you created an overflow menu that contains another sub-menu in Android’s ActionBar. Everything works well after you styled the background color of Widget.AppCompat.PopupMenu.

Once you tried a long click on the overflow MenuItem and proceed to selected a sub MenuItem, you notice the selected background color of the item is not transparent.

The cause for this is because you used android:background. The correct attribute to use is android:colorBackground.

That should fix it.

See sample XML code:

And in your theme style, add this:

It was a pain to have to look for a way to change the color of the Spinner widget’s selected item because the color displayed in the screen is dark.

Using Theme.AppCompat.Light.DarkActionBar, the problem is that the Spinner blends in with the ActionBar’s dark background (black in my case).

I did not want to have to create another layout just for the Spinner widget alone and use it as the actionLayout attribute value of the MenuItem.

So the only solution left is to do it programmatically.

Here is the code snippet:

Related Posts Plugin for WordPress, Blogger...