The options menu has a translucent background and I would like to make it solid and non-transparent. Is there a way?
4 Answers
Try this:
<style name="MyTheme" parent="android:Theme">
<item name="android:panelFullBackground">{your color or drawable}</item>
</style>
Also, see:
- http://code.google.com/p/android/issues/detail?id=4441
- How to change the background color of the options menu?
- Completely overriding menu panel: Android MenuItem Toggle Button
-
I used `panelBackground` instead of `panelFullBackground` and it worked – sports Aug 03 '16 at 06:16
Try this for android 4.0:
<style name="MyTheme" parent="@android:style/Theme.DeviceDefault">
<item name="android:popupMenuStyle">@style/MyPopupMenu</item>
</style>
<style name="MyPopupMenu" parent="@android:style/Widget.DeviceDefault.ListPopupWindow">
<item name="android:popupBackground">{your color or drawable}</item>
</style>
Also, the following site generate Action Bar Style :

- 81
- 3
-
This works perfect. Thanks. Btw, is there any easy way to change text color on the options menu? – Karthik Andhamil Jul 23 '13 at 19:51
set android:theme="myTheme"
, and define your own theme with whatever colours you want. Read up about Styles, and look at the android themes.xml.

- 32,953
- 42
- 145
- 236
If you don't want to style a whole theme and just change the options menu background then set the panelFullBackground property to a DRAWABLE RESOURCE of your liking. Setting it to a color directly doesn't work so either make one coloured - 9patch, if you want to save in size -image and set it to that or make a couple and make a selector drawable with an image for each state.
I put my definition in a style that i use for all the activities in my project using:
@drawable/optionsmenu_back
optionsmenu_back being a 9patch image with a solid colour...

- 6,494
- 3
- 24
- 24