J2ME LWUIT 菜单栏三个软按钮和样式
我在诺基亚 S40 手机上使用 lwuit-current 和 Java ME。
我想尽可能模仿默认的外观。
我发现,有 commandBehavior
本机,它提供了默认的外观 menuBar
,非常好。
1.) 我正在使用三个按钮,并且希望始终显示它们 - 不仅仅是一个按钮 + 选项按钮,这可能吗?请参阅http://img194.imageshack.us/img194/8877/menubarx.jpg
我尝试了 Display.getInstance().setThirdSoftButton(true);
但我仍然有一个空的未使用的第三个按钮。
通过 form.addCommand(buttonname);
添加的 SoftButtons
2.) 此本机 SoftButtons 布局还为我提供了带有程序行 + 时钟的附加标题;请参阅屏幕截图。这个标题可以从 LWUIT 中删除或更改吗?
提前致谢。
I'm using lwuit-current with Java ME on Nokia S40 phones.
I'd like to imitate the style as much as possible to the default look.
I discovered, there's commandBehavior
native which gives the default look for themenuBar
, which is very nice.
1.) I'm using three Buttons and would like to show them all the time - not only one Button + the Options Button, is this possible? See http://img194.imageshack.us/img194/8877/menubarx.jpg
I tried Display.getInstance().setThirdSoftButton(true);
but I still have an empty unused third button.
The SoftButtons where added via form.addCommand(buttonname);
2.) This native SoftButtons Layout also gives me the additional title with the program line + clock; see screenshot. Can this title be removed OR changed from LWUIT?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用本机菜单不适用于 3 软按钮模式,因为本机菜单实际上放弃了 LWUIT 对底层操作系统的 UI 的控制。 3 软按钮模式需要对 UI 有深入的了解,而 LWUIT 没有 MIDP API 来将该知识传达给设备。
出现在屏幕顶部的本机标题栏是设备 UI 的一部分,我们无法再控制。
此外,LWUIT(和诺基亚)的 3 软按钮模式是高度基于焦点的,这在基于触摸的 UI 中没有真正的意义,因为焦点应该没有什么意义。这就是为什么我建议您不要打开 3 软按钮模式。
您可以轻松地设置 LWUIT 样式以使用与本机主题类似的主题,为了在屏幕底部的栏中有 3 个按钮,您需要通过在 LookAndFeel 中设置菜单栏类来子类化并替换 MenuBar 类(您可以通过 UIManager 单例获得)。
Using native menus will not work with 3 softbutton mode since native menus effectively forfeit the control LWUIT has over that UI to the underlying OS. 3 softbutton mode requires deep knowledge of the UI and LWUIT has no MIDP API to communicate that knowledge to the device.
The native title bar appearing in the top of the screen is a part of the devices UI which we can no longer control.
Furthermore, LWUIT's (and Nokia's) 3 softbutton mode is highly focus based which doesn't really make sense in a touch based UI where focus should have little or no meaning. Which is why I suggest you don't turn on the 3 softbutton mode.
You can easily style LWUIT to use a theme similar to the native theme, in order to have 3 buttons in the bar at the bottom of the screen you will need to subclass and replace the MenuBar class by setting the menu bar class in the LookAndFeel (which you get via the UIManager singleton).