UINavigationController中的UIViewController不会按预期旋转。

| 我有一个UINavigationController,其根UIViewController仅支持纵向方向。当用户按下按钮时,第二个UIViewController被加载并推入堆栈,这个视图控制器(我们称之为secondViewController)仅支持横向方向。 通常会发生的情况是,接口在过渡到secondViewController的过程中会旋转,但这不会发生,尽管shouldAutorotateToInterfaceOrientation:在secondViewController上被调用。当我在显示secondViewController时手动倾斜设备时,它会按预期旋转,当切换回第一个UIViewController时,它将按原样旋转回纵向。 为了测试第一个UIViewController的允许接口Orientation是否对进程有影响,我设置了return YES;对于那里的所有接口,问题仍然存在。我还阅读了有关该主题的技术问答,但根据此文档,一切都应该没问题,UINavigationController是窗口的唯一子视图。 我完全以编程方式创建secondViewController(覆盖loadView),并且在其他应用程序中也可以使用此特殊情况。有人知道我在做什么错吗?     
已邀请:
显然,更改不会自动发生,下面给出必要的“推送”:
- (void) viewWillAppear:(BOOL)animated {
    [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight];
}
    

要回复问题请先登录注册