Android optionsmenu problem, the background is always transparent

My options menu always shows no background (the background is transparent). Who knows how to get rid of this?

My failed activity comes from another custom activity

I have this project on eclipse, and optionsmenu works normally, but since i migrated to Android studio, the option menu is always transparent. I tried to change the XML of the menu and create the menu programmatically, but the background is still transparent

resolvent:

It may be too late, but just in case people come here through Google (like me)

Theme.appcompat sets Android: panelbackground to @ Android: color / transparent, which is usually not a problem. Just like you extend actionbaractivity, it handles the creation of option panels with background. However, if you use a standard activity, use theme.appcompat, The options menu will be transparent. Fix it by changing Android: panelbackground or extending actionbaractivity. Actionbaractivity may be extended

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>