如何创建下拉菜单,使用LWUIT?存在哪些解决方案?
我需要创建下拉菜单(见图)。有哪些方法呢?我应该用什么?
I need to create drop down menu (see the picture). What methods are there? What should I use?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
创建一个派生 Dialog 的类,并在该 Dialog 内添加一个 List。当您单击按钮时,将显示带有顶部、底部、左侧和右侧四个参数的对话框。
要绘制下拉菜单的三角形,只需在派生调用的 Dialog 时实现 Paint 方法:
Create a class which derives Dialog , and add a List inside that Dialog. When you click the button then show the Dialog with the four params top, bottom, left and right.
To draw the triangle of the drop down menu just implement the
paint
method when you derive Dialog in which you call :LWUIT 1.5 包含一个弹出对话框,它正是这样做的。它还能够在指定时使用箭头边框。请参阅 LWUITDemo 的对话框演示。
LWUIT 1.5 includes a popup dialog which does exactly that. It also has the ability to use an arrow border when specified. See the LWUITDemo's Dialog demo.