How to change the background color of the options menu?


Question

I'm trying to change the default color for the options menu which is white: I want a black background for every item on the options menu.

I've tried some shoots like android:itemBackground="#000000" on the item element within the menu element but it didn't work.

How can I accomplish this?

1
92
5/21/2016 1:35:06 PM

After spending a considerable amount of time trying all the options, the only way I was able to get an app using AppCompat v7 to change the overflow menu background was using the itemBackground attribute:

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    ...
    <item name="android:itemBackground">@color/overflow_background</item>
    ...
</style>

Tested from API 4.2 to 5.0.

60
3/11/2015 8:42:20 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon