不能将UIViewController仅限制为纵向

我在UINavigationControllerembedded我的应用程序,我希望我的大部分ViewControllers除了一个是Portrait,我已经阅读了很多问题,但是找不到一个适合我的正确答案。

在我的目标中,我select了“ Device OrientationPortrait ,“ Landscape Right

我将这添加到我的第一个ViewController:

 -(BOOL)shouldAutorotate{ return NO; } -(NSUInteger)supportedInterfaceOrientations{ return (UIInterfaceOrientationPortrait); } 

但是当我旋转设备左侧的ViewController旋转以及。 为什么它在旋转?

你不能在iOS 7中轻松地描述你所描述的内容。 一个UINavigationController不会咨询它的孩子,他们喜欢什么旋转; 无论UINavigationController允许的旋转,无论哪个孩子恰好在那个时候显示,这些都是应用程序允许的旋转。

唯一真正合法且内置的强制旋转的方法是使用呈现的(“模态”)视图控制器来接pipe屏幕。 它的旋转设置被咨询,因为它现在负责屏幕。