What is the way (if there is a way) to customize the menu (the one triggered by the MENU button of the phone). I'm especially interested in two things:
- changing the background color from the standard light gray into a darker gray
- how the menu items are aligned. I have 4 items and they are automatically aligned 2x2, but I would prefer to have them all in one line (1x4)
background menu color in style.xml in your theme
You can also just implement the "onCreateOptionsMenu" method, that is usually used to display the standard menu, and display whatever you want in this case.
In my game, I implemented it to display a "Game Paused" dialog box when the menu button is pressed...
I created my own menu class. It maybe isn't exactly what you want but it should hopefully get you started. Here is the article I published and a downloadable link to the source code.
http://www.codeproject.com/KB/android/AndroidMenusMyWay.aspx
This answer works but crashed for me when using ActionBarSherlock. Here's a hacky workaround to make this work nontheless.
Use styles. This works for me on Android 5.0
... then the drawable is a regular selector
Not with the built-in menu framework.
You are welcome to intercept the MENU button (via
onKeyDown()
or something) and render what you want, but bear in mind that users will be expecting it to look like the rest of the menus do on their device.