本文主要是介绍Terminating app due to uncaught exception ‘UIApplicationInvalidInterfaceOrientation’ - iOS,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
iPad 端开发的时候禁止了竖屏模式,后期版本迭代的时候新增了拍照采集的功能,随后一切准备就绪调试的途中遇到了如下异常:
*** Terminating app due to uncaught exception ‘UIApplicationInvalidInterfaceOrientation’, reason: ‘Supported orientations has no common orientation with the application, and [ViewController
shouldAutorotate] is returning YES’
解决办法
若程序仅支持横屏可以尝试如下方式,在 AppDelegate 中添加如下 code 即可;
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_6_0 - (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {return UIInterfaceOrientationMaskAll;
}#endif
以上便是此次分享的全部内容,希望能对大家有所帮助!
这篇关于Terminating app due to uncaught exception ‘UIApplicationInvalidInterfaceOrientation’ - iOS的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!