团队,
从 iOS 7 开始,我的应用程序不响应方向。本来想通过pushViewController来推送屏幕,后来改成了presentViewController
之前
[viewController.navigationController PushViewController:landscapeCommentScreenAnimated:animated];
iOS7升级后:
[viewController.navigationController presentViewController:landscapeCommentScreen animated:YES completion:nil];
在 View Controller 中添加了以下方法
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskAll;
}
- (BOOL) shouldAutorotate {
return YES;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationLandscapeRight;
}
最佳答案
您不应在 supportedInterfaceOrientations
中返回 UIInterfaceOrientationMaskAll
。您应该返回UIInterfaceOrientationLandscapeRight
。
关于iOS 7 方向不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22389705/