views:

2409

answers:

2

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)
+2  A: 

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.

CommonsWare
Thanks. Then I will skip on this for now and maybe implement it at a later point when there's more time.
znq
i have seen custom arrangements of menus (as seen here http://androidandme.com/wp-content/uploads/2009/12/05.categories_optionmenu.jpg ) so there must be a way to do it.
mtmurdock
@mtmurdock: Not with the built-in menu framework.
CommonsWare
+2  A: 

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...

alocaly