我们有一个应用程序使用连接到音频插孔(或 iPhone7 或更高版本中的闪电端口)的附件。它需要以特定方向运行,具体取决于 iOS 设备。
目前在任何 iPhone 的模拟器或实际设备中设置设备方向都没有问题,除了 iPhoneX 模拟器。
当前设置方向的代码:
- (BOOL)shouldAutorotate {
return YES;
}
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
//device checks omitted
return UIInterfaceOrientationMaskPortraitUpsideDown;
}
堆栈跟踪:
TF uncaught exception reason : Supported orientations has no common orientation with the application, and [RootNavigationController shouldAutorotate] is returning YES
2017-10-05 09:35:02.692945+0200 [65045:74145368] *** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [RootNavigationController shouldAutorotate] is returning YES'
这适用于 iPhone5、iPhone6、iPhone6+、iPhone7 和 iPhone7+ 设备以及 iPhone8 模拟器。这似乎也不是 iOS11 的问题,因为我的 iPhone7 目前正在运行 iOS11。我目前唯一遇到问题的设备是 iPhoneX 模拟器。