LWUIT: How to show menu commands with another button

点点圈 提交于 2019-12-23 15:56:19

问题


In LWUIT we could add the commands button right into the Form with addCommand function like in this link http://lwuit.java.net/tutorial/events.html . Because I am currently developing the Nokia Asha Full Touch Apps soto show those commands I could simply click it at the top left button.

However, I've created the custom title bar, so now I have the Button inside the container as the title bar I've made

The 3 stripes above is the button with an image.

Do LWUIT have something like show menu like Android have Activity.openOptionMenu does?

Best Regards


回答1:


Hi there!(my first post in stackoverflow)

You have to use PopupList component of com.nokia.mid.ui. There is no problem to use this with LWUIT.

PopupList javadoc

As you can see in the javadoc. It is the example:

PopupList list1 = new PopupList();
PopupListItem item1 = new PopupListItem("Item1");
PopupListItem item2 = new PopupListItem("Item1", image1);
list1.appendItem(item1);
list1.appendItem(item2);
list1.setVisible(true);

The position of the menu will be good to your target.



来源:https://stackoverflow.com/questions/13597932/lwuit-how-to-show-menu-commands-with-another-button

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!