锁定风暴方向 [英] Lock orientation on Storm

查看:93
本文介绍了锁定风暴方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在Storm(和Strom 2)设备上以纵向模式锁定我的应用程序. 我为此使用Ui.getUiEngineInstance().setAcceptableDirections(Display.DIRECTION_PORTRAIT);.

I need to lock my application in portrait mode on a Storm(and Strom 2) device. I use Ui.getUiEngineInstance().setAcceptableDirections(Display.DIRECTION_PORTRAIT); for this.

这是问题所在:

屏幕方向仅更改一次 设备旋转到一个方向 受提供的指示支持 参数.

The screen direction only changes once the device is rotated to a direction supported by the provided direction parameter.

(如果用户将设备置于横向模式并打开该应用程序,则该应用程序将以横向模式打开,并且仅当/如果用户将设备旋转至纵向模式,则该应用程序将锁定为纵向模式.

If the user has the device in landscape mode and opens the application, the application will open in landscape and will only lock to portrait mode when/if the user rotates the device to portrait mode.

即使在上述情况下,是否可以通过任何方式将应用程序强制设为纵向模式?

Is there any way to force the application in portrait mode even in the case I described above?

推荐答案

我制作了一个静态方法,该方法是从应用程序的main()方法调用的.

I have made a static method that I call from my application's main() method.

请参阅我对此问题的完整代码:

See the full code in my answer to this question: How to fix alignment for vertical and portrait screen in BlackBerry?

这篇关于锁定风暴方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆