// // UINavigationController+Orientation.m // AVDemo // // 让导航控制器将方向决策交给顶层 ViewController // #import "UINavigationController+Orientation.h" @implementation UINavigationController (Orientation) - (BOOL)shouldAutorotate { // 将决策权交给顶层 ViewController return [self.topViewController shouldAutorotate]; } - (UIInterfaceOrientationMask)supportedInterfaceOrientations { // 将决策权交给顶层 ViewController return [self.topViewController supportedInterfaceOrientations]; } - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { // 将决策权交给顶层 ViewController return [self.topViewController preferredInterfaceOrientationForPresentation]; } @end