iOS 7方向无法正常工作

时间:2014-03-13 20:04:46

标签: ios ios7

我的应用程序没有响应iOS 7以后的Orientations。我试图通过pushViewController推送屏幕,然后我改为presentViewController

前         [viewController.navigationController pushViewController:landscapeCommentScreen animated:animated];

iOS7升级后:

 [viewController.navigationController presentViewController:landscapeCommentScreen animated:YES completion:nil];

在视图控制器中添加了以下方法

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskAll;
}


- (BOOL) shouldAutorotate {
    return YES;
}


- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
    return UIInterfaceOrientationLandscapeRight;
}

1 个答案:

答案 0 :(得分:1)

您不应该在UIInterfaceOrientationMaskAll中返回supportedInterfaceOrientations。您应该返回UIInterfaceOrientationLandscapeRight