Reputation: 581
Facts:
Developed a iPhone app which is rotatable in general but each single view is not rotatable at all. We just need the rotation feature in one explicit view, so we had to enable rotation in general.
Now, when one installs the app on iPad and opens it in landscape mode, the app shows up in landscape mode and you cannot rotate it back to portrait if you turn the iPad (which seems to be logically because rotation is not allowed in the views).
I do not experience that in the simulator :(
Anybody an idea what to do? Sorry for not including code...
Upvotes: 3
Views: 1270
Reputation: 1030
In addition to Mike M answer, I have this in mi RootViewController:
Objective-C
- (BOOL)shouldAutorotate {
return NO;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationPortrait;
}
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
Swift
override func preferredInterfaceOrientationForPresentation() -> UIInterfaceOrientation {
return UIInterfaceOrientation.Portrait
}
override func shouldAutorotate() -> Bool {
return false
}
override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
return UIInterfaceOrientationMask.Portrait
}
Upvotes: 0
Reputation: 4436
Try adding "Supported interface orientations (iPad)" and ensure that "Portrait Bottom Home Button" is the first in the list. Also, amend your root view controller so that it only shows up in Portrait.
Upvotes: 2