Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Trusted Contributor
Posts: 174
Registered: ‎09-04-2011
My Device: Bold
My Carrier: at&t
Accepted Solution

How to set the initial direction for UI screen

[ Edited ]

Hi, expert,

 

currently our UI is really programmed to only handle the screen of north direction. So we use the following code to set the acceptable direction:

 

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

 

However this setting only takes into effect when device is rotated after UI is launched. It doesn't seem setting the initial direction. If our UI is launched while phone is at landscape position, our UI would be launched at the landscape position,  however it would flip to north direction if phone is rotated to north position. At this point, UI display is messed up. After that, it won’t change back to landscape direction even if phone is changed to landscape direction which makes sense since we set the acceptable direction to north.

 

Any idea how to set the intial direction? From my current search, there is no way to do so.

 

 

Trusted Contributor
Posts: 174
Registered: ‎09-04-2011
My Device: Bold
My Carrier: at&t

Re: How to set the initial direction for UI screen

We didn't find a way to do this. We found out that it is easier to just let screen rotate freely instead of restrict it, so we changed our code to let it free rotate.