Android OptionsMenu issue, background is always transparent
Asked Answered
B

1

3

My options menu always shows no background (background is transparent). Does anyone know how to ged rid of this?

My activity where the fail is originated, extends from another custom activity.

I had this project on eclipse and the optionsmenu worked normally, but since I migrated to AndroidStudio, the options menu is always transparent. I've tried to change the menu's xml, and create the menu programatically, but the background still transparent.

Burglary answered 5/1, 2015 at 21:5 Comment(2)
You should copy your gradle file's content, as well as style.xmlHelicon
Please post the menu XML. As well, there are still some subtle incompatibilities between Eclipse and Android Studio. For example, I've got some code that will show a notification icon in color if compiled through Eclipse, but that same notification icon will be black and white if imported into Android Studio.Lasting
B
14

Probably too late, but in case people people end up here via Google (like me).

Theme.AppCompat sets android:panelBackground to @android:color/transparent, which is normally not a problem as if you extend ActionBarActivity it handles the options panel creation with a background. However if you are using a standard Activity, with Theme.AppCompat, the options menu will be transparent. Fix by either changing the android:panelBackground or extending ActionBarActivity. Probably extending ActionBarActivity.

Blueness answered 14/3, 2015 at 3:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.