开发者

Blackberry:lock application in portrait mode?

开发者 https://www.devze.com 2023-03-15 17:04 出处:网络
I want to start my application in portrait mode, always, on a BlackBerry Storm, even then when device is in landscape mode.

I want to start my application in portrait mode, always, on a BlackBerry Storm, even then when device is in landscape mode.

How cou开发者_Python百科ld I do that?

I know we can control the orientation after opening my app, by:

UiEngineInstance ui = Ui.getUiEngineInstance();
ui.setAcceptableDirections(Display.DIRECTION_NORTH); 

but how to open the app in portrait mode?


Use following just one line of code in constructor of each screen class.

Ui.getUiEngineInstance().setAcceptableDirections(Display.DIRECTION_PORTRAIT);

I also get the problem with this in OS 7 phone, So I have fixed by issue with using below code:

Ui.getUiEngineInstance().setAcceptableDirections(Display.DIRECTION_NORTH);

0

精彩评论

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