Question

I have a strange problem. My app keeps starting in landscape mode. If I open it in simulator it rotates to landscape mode automatically. When I start it on iPhone it firstly starts in landscape mode and then shortly after it rotates to correct position. I have set "Initial interface orientation" in .plist to portrait, but that changed nothing.

Was it helpful?

Solution

I had the same problem. If you go to your Supported Interface Orientations you'll see Item 0 ... Item 1 ...

And so on. If you edit this list so that Portrait (bottom home button) is the first item in the list then your app will open in portrait mode. You can still support other orientations as items 1 thru 3.

OTHER TIPS

go to your supported device orientations and check if you have portrait mode selected

cancel orientations in plist

if you only support Landscape, write code

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}

it work for me.

In XCode 6.4, I just unchecked all 4 of the device orientations and reselected them starting with portrait in the Deployment Info for the Target app. Apparently the order that they are checked here controls the order of the values in the plist file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top