I have an universal project, and want to keep landscape from very beginning of star-up for iPhone and portrait for Pad. How can I do it?
Asked
Active
Viewed 404 times
2 Answers
0
That's not possible. iPhone apps always have to start in Portrait orientation. Any game you see that has landscape-only display is still starting showing a portrait default image and the root view controller then can be landscape-only.
On iPad you can restrict the app orientation to Landscape and also have it start in Landscape.
The iPhone restriction is enforced by Apple and they won't approve an iPhone app that restricts itself to Landscape start.

Stefan
- 5,203
- 8
- 27
- 51

Cocoanetics
- 8,171
- 2
- 30
- 57
0
If the device is already in landscape position it will start as landscape, but if you want your program to work always in landscape position and never flip to portrait, you have to set the orientation to landscape in each class you create:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationLandscape || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown);
}
-
Thanks, but still not resolve my problem, I know I can control in each view controller, is there any way to globally control it: iPad = Landscape and iPhone = Portrait. – LiangWang Dec 13 '12 at 06:29
-
1yes I think in the info plist you can add, Supported interface orientations(ipad), and there you can set it to lanscape, and Supported interface orientation (iphone) and you can set it to portrait – coder Dec 13 '12 at 06:39
-
yes, that's what i'm looking for, it seems that i could not do that – LiangWang Dec 13 '12 at 06:40