How To Set Android ActionBar AppCompat PopupMenu Selected Item Background After Long Click

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:

Related Posts Plugin for WordPress, Blogger...

Leave a Reply

Your email address will not be published. Required fields are marked *