iOS 7 方向不工作

标签 ios ios7

团队,

从 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/

相关文章:

ios - 如何在 IOS xcode 中使用循环创建多维数组

iphone - SpriteKit : Passing data between scenes

ios - UILabel 上的 clipsToBounds 不起作用

ios - 我将如何在同一脚本中检索扩展类之外的数据数组

ios - 尼尔· swift 词典

objective-c - iOS 7 多任务处理和 completionHandler

objective-c - 在 iOS7 上同时播放 TTS 和音乐?

ios - 计算路线后绘制的注释移动到用户的位置 - Skobbler

iphone - UIButton 标题上方的中心图像

ios - 包含 NSString 数组的 JSON