开发者

How to detect j2me mobile device screen orientation at LWUIT?

I want to know how to detect screen or开发者_如何学JAVAientation like portrait or landscape mode at J2ME LWUIT. Can LWUIT detect screen orientation automatically or need to write code manually?


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().


What about Display.getInstance().isPortrait()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜