加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

[_UIAlertShimPresentingViewController shouldAutorotate] is r

发布时间:2020-12-14 02:12:36 所属栏目:百科 来源:网络整理
导读:今天做开发的时候遇到一个很大的问题,就是不需要屏幕的旋转,所以我在UINavigationController中设置了屏幕的方向,但是在UIAlertView提示的地方出现这样的错误: Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation',re

今天做开发的时候遇到一个很大的问题,就是不需要屏幕的旋转,所以我在UINavigationController中设置了屏幕的方向,但是在UIAlertView提示的地方出现这样的错误:


Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation',reason: 'Supported orientations has no common orientation with the application,and [_UIAlertShimPresentingViewController shouldAutorotate] is returning YES'



很是郁闷,在网上找到具体解决方法:

通过查阅官方文档,发现supportedInterfaceOrientations方法的返回值是UIInterfaceOrientationMask类型的,所以应该用UIInterfaceOrientationMaskPortrait。UIInterfaceOrientationMask类型从iOS6就有了,只不过到iOS8.3才会崩溃。

至于preferredInterfaceOrientationForPresentation方法,返回值还是老的UIInterfaceOrientation类型。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读