Cocoa touch UINavigationController中的自动旋转

Cocoa touch UINavigationController中的自动旋转,cocoa-touch,uinavigationcontroller,orientation,autorotate,Cocoa Touch,Uinavigationcontroller,Orientation,Autorotate,有一个UINavigationController和rootViewController(作为root)以及secondViewController(作为孩子)。rootViewController应该能够旋转到任何方向(如预期的那样工作,我只是覆盖shouldAutorotateToInterfaceOrientation),但是secondViewController应该只在纵向模式下工作(在这里,我将shouldAutorotateToInterfaceOrientation设置为 问题:

有一个UINavigationControllerrootViewController(作为root)以及secondViewController(作为孩子)。rootViewController应该能够旋转到任何方向(如预期的那样工作,我只是覆盖shouldAutorotateToInterfaceOrientation),但是secondViewController应该只在纵向模式下工作(在这里,我将shouldAutorotateToInterfaceOrientation设置为

问题:从根视图控制器导航到第二视图控制器后,在横向中,第二视图控制器不会将其UI切换回纵向。有正确的方法吗?

尝试放置一个

[super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];  
在你申报后,看看是否有效

[super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];