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

Native Development

Reply
New Contributor
chocolatemoose
Posts: 8
Registered: ‎01-05-2012
My Device: Playbook
My Carrier: None

Orientation vs the simulator

Is anyone else seeing spooky orientation behaviour in the simulator?

 

For me, the very first time I install and run my app on the simulator, it correctly applies the landscape .bar setting, and the app works fine.

 

However, every time after this, it launches in portrait mode (with the game squashed into the wrong aspect ratio ... which I'm pretty sure if my code's doing - but the issue is why it's launching in portrait mode in the first place). So if I kill the app and restart it: BOOM portait mode. If I rebuild it in Momentics and run in it the simulator: BOOM portrait mode.

 

The only way to get landscape back seems to be deleting the app off the simulator and re-running it (and again, it will only run correctly once).

 

Is anyone else seeing this (I'm on OSX btw)?

 

If not, I'm wondering if this is some awful side-effect of the orientation code I had to write to get it all running correctly on the first version of the SDK.

 

 

Please use plain text.
BlackBerry Development Advisor
daryl_martin
Posts: 118
Registered: ‎11-01-2011
My Device: N/A
My Carrier: Rogers

Re: Orientation vs the simulator

Thanks for reporting this issue.  

 

What version of the simulator are you running?  

Please use plain text.
New Contributor
chocolatemoose
Posts: 8
Registered: ‎01-05-2012
My Device: Playbook
My Carrier: None

Re: Orientation vs the simulator

After several late (late) nights I finally got it working. 

 

The only way I could find to allow orientation that works on both the BB10 and the Playbook was to set the bar-descriptor Orientation to "Auto-orient", and then handle both the viewport and navigator orientation manually from the orientation change handler.

 

The one issue I hit was there is a *wicked* slowdown when calling navigator_set_orientation to get the navigator to re-orient. If I comment this out, my app re-orients instantly. As soon as I add this call in (which you need to to get the keyboard and gestures in the correct orientation), it hangs the app for (quite literally) 5 seconds+ when you change the device orientation.

 

 

Please use plain text.