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

Web and WebWorks Development

Reply
Developer
supraking
Posts: 99
Registered: ‎10-04-2010
My Device: Not Specified
Accepted Solution

Change and Lock Orientation from within App?

Hey guys,

 

I've searched extensively but haven't been able to find an answer to this question (perhaps because the answer is NO).

 

I'd like to run my app in "auto" orientation mode, but when the user reaches a specific screen, I'd like to rotate and lock it to landscape only. When the user pops out of that screen, I'd like it to revert to auto. Any idea on how to accomplish this (if possible)?

 

Your help is greatly appreciated!

Please use plain text.
Developer
nunodonato
Posts: 313
Registered: ‎03-28-2012
My Device: Curve 9360, Playbook, BB10 Dev Alpha
My Carrier: TMN

Re: Change and Lock Orientation from within App?

Are you talking about BB10?

 

If yes, yes you can.

Just make sure you have the blackberry.app feature enabled in your config.xml file.

 

You can then call

blackberry.app.lockOrientation(orientation)

blackberry.app.unlockOrientation()

blackberry.app.rotate(orientation)

 

orientation can be one of the following values: landscape-primary, landscape-secondary, portrait-primary, portrait-secondary.

 

happy coding

 

Nuno
theBBthing.wordpress.com - my BlackBerry development blog: news, tips and tutorials
bitoutsidethebox.com - re-imagining digital solutions


Please use plain text.
Developer
supraking
Posts: 99
Registered: ‎10-04-2010
My Device: Not Specified

Re: Change and Lock Orientation from within App?

Dude -- you rock. Thanks!

Please use plain text.