Page 1 of 1
Block auto rotation?
Posted: Fri Dec 10, 2010 9:45 pm
by belgarion
Hi everyone,
I'm trying to force the iphone to saty in vertical (portrait) mode.
I want to block it from rotating and therefore adapating my app to the horizontal mode.
Is there any way to do it (or fake it) ?
Thank you all for your help !
AD
Re: Block auto rotation?
Posted: Fri Dec 10, 2010 10:38 pm
by RickD
Hi belgarion:
Not a problem. What I do is include a "iphoneLockOrientation" command in my on openStack code and it will hold whatever default orientation you have selected under the Standalone Application Settings for iOS.
Works like a charm!
Cheers
Re: Block auto rotation?
Posted: Fri Dec 10, 2010 11:02 pm
by belgarion
Hey RickD !
Thanks a lot for your fast answer and great help !
Big Big Thanks !
Beslgarion
Re: Block auto rotation?
Posted: Thu Dec 16, 2010 9:56 am
by observ3
Thank you!!!
I hope that the iOS documentation is expanded soon... hopefully integrated into the dictionary.
Re: Block auto rotation?
Posted: Fri Dec 17, 2010 5:01 am
by Randy Hengst
Hi All,
I'm having trouble getting my app to stick in one orientation. Before I describe my problem would one of you try something for me and let me know what happens.... First, I understand you are making a app to work only in portrait mode, correct? If so, tell me what settings you used in the iOS Application Settings.... I assume Initial Orientation is set to portrait and Supported Orientations is set to portrait.
Now, hold your real device (I'm using an iPod Touch) in landscape mode and open your app.... what happens?
take care,
randy hengst
Re: Block auto rotation?
Posted: Fri Dec 17, 2010 5:57 am
by wsterdan
I'm using Landscape and an iPad (rather than Portrait and an iPod) but it works perfectly, the app starts up on the device in Landscape and stays there, no matter what way I turn it.
-- Walt Sterdan
Re: Block auto rotation?
Posted: Fri Dec 17, 2010 2:54 pm
by Randy Hengst
Hi Walt
Thank for your response.
What happens when you hold the iPad in portrait and open your app? I'm using iPod and want my app to only display in landscape right. When I open in portrait, the app shows in landscape right and then immediately rotates to portrait. In fact, when I open the app with the iPod held in any orientation other than landscape right, the app rotates immediately after opening.
I've set the start up and allowed orientations to landscape right.
I've placed iphoneLockOrientation in the openStack handler and in an on StartUp handler....
How have you set things up? I simply can't see what step I'm missing.
randy hengst
Re: Block auto rotation?
Posted: Fri Dec 17, 2010 6:10 pm
by kevinmiller
We've explained how to do this in more detail in the latest version of handbook (4.5.3-dp-1/rc-1). You need to use iphoneSetAllowedOrientations in a 'startup' handler.
Re: Block auto rotation?
Posted: Fri Dec 17, 2010 8:37 pm
by Randy Hengst
Hi Kevin,
Yes, I know... my startup handler is in the stack script. Is that where it goes? The do not see in the docs where to put the handler.
on startup
iphoneSetAllowedOrientations "landscape right"
iphoneLockOrientation
end startup
I have tried the handler without the lock statement. I've tried to put both statements in the openStack handler. I've tried calling the startUp handler from the openStack handler.
I am working with the same stack that I submitted to Apple using 4.5.1 and the plugin version... the landscape worked and stuck using that version.
take care,
randy
Re: Block auto rotation?
Posted: Sat Dec 18, 2010 7:27 am
by wsterdan
Randy Hengst wrote:
What happens when you hold the iPad in portrait and open your app? I'm using iPod and want my app to only display in landscape right. When I open in portrait, the app shows in landscape right and then immediately rotates to portrait. In fact, when I open the app with the iPod held in any orientation other than landscape right, the app rotates immediately after opening.
As mentioned, I'm building a landscape app; if I open the app in portrait, the first image shows up correctly (landscape rotated, top of picture pointing to the left). Interestingly enough, under 4.5.2 (build 1150) the picture starts off scrunched, then fills the screen. The image is scrunched vertically (in relation to the picture, regardless of orientation) and immediately expands to fill the screen. It only lasts for a small fraction of a second, but It doesn't happen with any of the earlier builds.
-- Walt Sterdan