Reputation: 6247
In my info plist, I have defined Supported interface orientations (iPad) as all orientations, and it works. The only problem is if I start in landscape mode, it starts as portrait, but If I rotate and then rotate back, it fixes. So how can I make it so it adopts to the startup orientation? thANKS.
Upvotes: 3
Views: 2810
Reputation: 4164
I noticed that the order of the interface orientations from the main .plist files is important also. E.g http://monosnap.com/image/jJeImyVp6G3Mq1uXLSAVRA0te2VwgJ Means that at startup the app will be in landscape, with the home button on the right.
Upvotes: 0
Reputation: 2347
The UIViewController that is installed as the root controller via [window addSubview:viewController.view];
should implement the shouldAutorotateToInterfaceOrientation
function and return YES to all supported orientations.
The iPad starts the views with Portrait orientation and then rotates all the views by calling willRotateToInterfaceOrientation
function with a duration of 0.
Upvotes: 1
Reputation: 50707
You can force the orientation you need by implementing the following in either your didFinishLaunchingWithOptions:
or in a view controller's viewWillAppear:
.
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft animated:NO];
Upvotes: 6