문제

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