如何在 LWUIT 检测 j2me 移动设备屏幕方向?

发布于 2024-12-06 02:08:04 字数 71 浏览 2 评论 0原文

我想知道如何在 J2ME LWUIT 中检测屏幕方向,例如纵向或横向模式。 LWUIT可以自动检测屏幕方向还是需要手动编写代码?

I want to know how to detect screen orientation like portrait or landscape mode at J2ME LWUIT. Can LWUIT detect screen orientation automatically or need to write code manually?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

翻身的咸鱼 2024-12-13 02:08:04

Shai Almog 在论坛上这样说,谈到屏幕方向

Shai Almog 说...

我们没有明确支持方向,手机发送屏幕尺寸变化的事件,它为我们支持方向。我们知道大小已经改变,但我们不知道方向已经改变。
开发人员无法控制方向更改,因为这是根据画布事件自动完成的。
http://lwuit.blogspot .com/2008/05/new-video-from-chen-of-lwuit-on-devices.html

我认为它可以帮助你。我现在正在使用 LWUIT 资源编辑器开发一个应用程序,并且会自动检测屏幕方向。无论如何,你必须在 API http://lwuit.java.net/nonav/iodocs 中查找 Display /index.html,您可以使用一些方法来确定方向,例如 Display.canForceOrientation()Display.lockOrientation()

Shai Almog said this in the forum, talking about screen orientation

Shai Almog said...

We don't explicitly support orientation, the phone sends an event of screen size change and it supports orientation for us. we know the size has changed but we don't know the orientation has changed.
The developer can't control orientation changes since this is done automatically based on events to the canvas.
http://lwuit.blogspot.com/2008/05/new-video-from-chen-of-lwuit-on-devices.html

I think it can help you. I am developing an app with LWUIT now, using the LWUIT resource editor, and the screen orientation is detected automatically. Anyway you must look for Display in API http://lwuit.java.net/nonav/iodocs/index.html, there are some methods that you can use for the orientation, like Display.canForceOrientation() or Display.lockOrientation().

瞎闹 2024-12-13 02:08:04

Display.getInstance().isPortrait() 怎么样

What about Display.getInstance().isPortrait()

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文