【发布时间】:2014-11-10 01:48:52
【问题描述】:
在 iOS8 中让我的应用在纵向和横向之间旋转时遇到问题。它在 iOS7 中运行良好。在我的主视图控制器中,我有以下内容。
- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation {
return YES; // for iOS7 compatibility
}
- (BOOL)shouldAutorotate {
return YES;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskAll;
}
我可以确认(通过调试)后两个是在 iOS8 下启动时调用的,但不是在屏幕旋转时调用的。
我正在使用自动布局并且在 IB 中的错误和警告为零。 (启动时调试器中也没有)。
Info.plist 文件包含 'UISupportedInterfaceOrientations' 和 'UISupportedInterfaceOrientations~ipad' 的所有 4 个方向。
这有点不寻常,因为在模拟器 (8.1) 中,无论方向如何,应用程序总是以纵向模式启动。但是,在设备 (8.0) 上,应用程序始终以当前方向启动。然而,两者都不允许应用内轮换。
我搜索了互联网和 Apple 的文档。任何朝着正确方向的想法或指示将不胜感激。
【问题讨论】:
标签: ios objective-c cocoa-touch ios8 uikit