When you use the UINavigationController or UITabbarViewController, the application always does what they say in their methods shouldAutorotate, supportedInterfaceOrientations .
You can add a category to redirect these methods to the controller that they currently display. Like this:
@implementation UINavigationController (Rotation_IOS6) -(BOOL)shouldAutorotate { return [[self.viewControllers lastObject] shouldAutorotate]; } -(NSUInteger)supportedInterfaceOrientations { return [[self.viewControllers lastObject] supportedInterfaceOrientations]; } - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation]; } @end
Similar to UITabbarViewController.
krafter
source share