2
votes

My iPad app contains a single view somewhere in the app that supports landscape mode.

For the shouldAutorotateToInterfaceOrientation in that view to be called I had to declare in the info.plist that landscape is supported.

Problem:

The UITabController which is shown when the app is launched doesn't support landscape mode and I made sure to specify it in all the tabbar's view controller. Yet, when the app is launched while the device is in landscape mode, the tabcontroller is shown in landscape and all the tabs looks distorted.

Setting the info.plist to support only portrait mode forces the app to launch correctly, but then the shouldAutorotateToInterfaceOrientation is ignored on the rotatable viewcontroller.

Another option I tried upon launch is:

[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait];

That actually forced the app to show in portrait, but also made the app ignore further device rotation on the rotatable viewcontroller.

Update: This is iOS6 issue only and cannot be spotted on the simulator

1

1 Answers

2
votes

Check this iOS 6 rotations: supportedInterfaceOrientations doesn´t work?

You need to subclass your TabBarController and override its shouldAutoRotateToInterfaceOrientation to control how this ViewController orients itself.