Blackberry:lock application in portrait 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);
精彩评论