ios – preferredInterfaceOrientationForPresentation必须返回支持的接口方向

概述这个错误没有意义,因为首选方向UIInterfaceOrientationLandscapeRight是由支持的方向返回的 //iOS6-(BOOL)shouldAutorotate{ return NO;}-(NSUInteger)supportedInterfaceOrientations{ return (UIInterfaceOrientationLandsc 这个错误没有意义,因为首选方向UIInterfaceOrIEntationLandscapeRight是由支持的方向返回的

//iOS6-(BOol)shouldautorotate{    return NO;}-(NSUInteger)supportedInterfaceOrIEntations{    return (UIInterfaceOrIEntationLandscapeRight | UIInterfaceOrIEntationLandscapeleft);}- (UIInterfaceOrIEntation)preferredInterfaceOrIEntationForPresentation{    return UIInterfaceOrIEntationLandscapeRight;}

错误:

Terminating app due to uncaught exception
‘UIApplicationInvalIDInterfaceOrIEntation’,reason:
‘preferredInterfaceOrIEntationForPresentation must return a supported
interface orIEntation!’

解决方法 您的代码应如下所示:

-(BOol)shouldautorotate{    return NO;}-(NSUInteger)supportedInterfaceOrIEntations{    return UIInterfaceOrIEntationMaskLandscape;}- (UIInterfaceOrIEntation)preferredInterfaceOrIEntationForPresentation{    return UIInterfaceOrIEntationLandscapeRight;}

此外,确保在Info.pList中为应用程序设置了正确的方向,因为从supportedInterfaceOrIEntations返回的内容与Info.pList相交,如果它找不到一个常见的,那么您会得到该错误。

总结

以上是内存溢出为你收集整理的ios – preferredInterfaceOrientationForPresentation必须返回支持的接口方向全部内容,希望文章能够帮你解决ios – preferredInterfaceOrientationForPresentation必须返回支持的接口方向所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1044254.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-24
下一篇2022-05-24

发表评论

登录后才能评论

评论列表(0条)

    保存