我正在使用iOS 6的新方向方法,它运行良好。我的视图在竖屏模式下呈现,当我呈现viewcotrnoller并将其旋转到横屏时,关闭该viewcontroller后它会恢复方向。这意味着它应该保持在横屏状态,但它变成了竖屏状态。
以下是我的代码:
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskAll;
}
// Tell the system It should autorotate
- (BOOL) shouldAutorotate {
return YES;
}
// Tell the system which initial orientation we want to have
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationMaskPortrait;
}
我认为这是由于preferredInterfaceOrientationForPresentation方法引起的,但是我没有找到解决方法。请帮忙!谢谢!