LWUIT:如何使用另一个按钮显示菜单命令 [英] LWUIT: How to show menu commands with another button
问题描述
在LWUIT中,我们可以使用addCommand
函数将命令按钮直接添加到窗体中,例如此链接
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.
但是,我已经创建了自定义标题栏,所以现在我将容器内的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
上面的3个条纹是带有图像的按钮.
The 3 stripes above is the button with an image.
LWUIT是否具有类似于Android的显示菜单之类的功能?
Do LWUIT have something like show menu like Android have Activity.openOptionMenu
does?
最好的问候
推荐答案
您好!(我在stackoverflow中的第一篇文章)
Hi there!(my first post in stackoverflow)
您必须使用com.nokia.mid.ui的PopupList组件. 在LWUIT上使用它没有问题.
You have to use PopupList component of com.nokia.mid.ui. There is no problem to use this with LWUIT.
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.
这篇关于LWUIT:如何使用另一个按钮显示菜单命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!