I have:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return YES;
}
in all my view controllers, in the app summary all rotations are selected, in the info.plist all rotations are added to the supported key. I even have:
autoresizesSubviews = YES;
added to all the view controllers just in case since I'm not using nibs.
Now here's where it gets weird. On the iPad, if the device is in landscape before I open the app, then open the app and load a subview it rotates to landscape, until I force close the app and restart it. I've tried deleting the app and rebuilding, I've tried this on several physical devices and still not change. I've even added a NSLog call to the shouldAutoRotate method and it never gets called. I've even tried subclassing UINavigationController with a dummy nag controller and adding the shouldAutoRotate method to the dummy class.
Finally, if I set it to landscape only the status bar will be in the landscape position but the rest of the view will be in standard portrait.
Any ideas on where to start diagnosing this?
Have you set self.window.rootViewController
in your AppDelegate
's didFinishLaunchingWithOptions
? I have noticed that in iOS 5 and below, the app rotates correctly even if you have not set the rootViewController
, but you must set it in iOS 6.
It might also be worth noting, that autorotation has changed (slightly?) in iOS 6. Instead of only one method (shouldAutorotateToInterfaceOrientation
), there are now two methods (shouldAutorotate
and supportedInterfaceOrientations
) for autorotation behavior.