Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the background color of the options menu?

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?

like image 828
feragusper Avatar asked May 31 '10 14:05

feragusper


People also ask

How do I change the background color mode?

Select Start > Settings > Personalization > Colors, and then choose your own color, or let Windows pull an accent color from your background.

How can I change the color of my menu bar in Android?

Just go to res/values/styles.edit the xml file to change the color of action bar.


1 Answers

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.

like image 102
TheIT Avatar answered Oct 04 '22 10:10

TheIT