Reputation: 4097
I have tried:
--> Subclassing UINavigationController and overriding autorotate methods
--> Overriding autorotate methods on MyViewController
--> And both.
Note: Also, I tried with autorotate sets NO and YES
This is my code:
NavigationControllerNoAutorotate:
@implementation NavigationControllerNoAutorotate
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
return UIInterfaceOrientationPortrait;
}
- (BOOL)shouldAutorotate {
return YES;
}
@end
MyViewController:
- (BOOL)shouldAutorotate {
return NO;
}
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
- (UIInterfaceOrientationMask)navigationControllerSupportedInterfaceOrientations:(UINavigationController *)navigationController {
return UIInterfaceOrientationPortrait;
}
Upvotes: 1
Views: 2528