0

My universal app (targeting 4.3) opens in landscape and then rotates to portrait, if user is holding device in portrait orientation. This doesn't occur on the Pad. Also I can't see anything in the plist or code that would make this happen. Has anyone else experienced this and found a solution.

EDIT: Haven't found a solution but the issue appears to be the order of the "Supported interface orientations" in the plist. This doesn't affect the Pad.

On the phone, if the first item in the plist is landscape, then the app will open in landscape regardless of the phone's actual orientation. Once loaded, if the phone is in portrait, the app will rotate to portrait. And vice versa, if the first item is portrait, then the app will open in portrait. If phone orientation is landscape it will rotate when loaded.

I'm wondering if this is just an undocumented feature.

2
  • What exactly your issue is?? Your question is confusing me.. Please elaborate. Feb 10, 2012 at 5:10
  • Have you coded anything which detects orientation of a device?? If yes please post code.. Feb 10, 2012 at 5:14

1 Answer 1

0

try this

if([[UIDevice currentDevice] orientation]==1)
{
    [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait];
}
else
{
    [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortraitUpsideDown];
}
1
  • 1
    Thanks but this actually made it worse. Dropped the snippet in the appdelegate and now it goes landscape to portrait and then back to landscape in the blick of an eye. I'll need to dig further
    – RobCroll
    Feb 13, 2012 at 0:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.