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
以上便是此次分享的全部内容,希望能对大家有所帮助!
网友评论