I have a LWUIT Form which has 3 containers, each with its own content. Two commands('BackCommand' & 'ExitCommand') have been added to the form.

These commands are shown at the bottom of the screen. The commands hog up quite a lot of space on the screen. Can I auto hide these commands the way we can autohide a taskbar in windows?

Whenever the user pressed the left/right soft button, I want the two commands to pop-up and then become active for receiving events generated by the form.

How do I achieve this?

有帮助吗?

解决方案

You need to derive the MenuBar class introduced in LWUIT 1.5 and override the functionality of the menu bar any way you like e.g. setting the MenuBar to visible "false" within the form.

其他提示

To hide the command's bar write in the class of your Form :

removeCommand(BackCommand);
removeCommand(ExitCommand);

To reshow the commands you must overide the keyReleased(int keycode) method and get the gameAction of the key pressed by using Display.getInstance().getGameAction(keycode). To do this : first show the value of the gameAction of the two softbuttons in a Dialog, then in your if test compare the getGameAction to these numbers.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top