首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >支持的方向与应用程序没有共同的方向,并且shouldAutorotate返回YES‘

支持的方向与应用程序没有共同的方向,并且shouldAutorotate返回YES‘
EN

Stack Overflow用户
提问于 2012-09-22 12:06:57
回答 14查看 71K关注 0票数 95

我的应用程序(iPad;iOS6)是一个仅适用于风景的应用程序,但当我尝试使用UIPopoverController显示图片库时,它抛出了这个错误:Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES.我已经尝试更改了很多代码,但没有成功。

EN

Stack Overflow用户

发布于 2012-09-23 02:02:12

我也有同样的问题,这个答案https://stackoverflow.com/a/12523916适用于我。我想知道是否有更优雅的解决方案。

My code:

代码语言:javascript
运行
复制
UIImagePickerController  *imagePickerController = [[NonRotatingUIImagePickerController alloc] init];
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

UIPopoverController  *popoverVC = [[UIPopoverController alloc] initWithContentViewController:imagePickerController];    

[popoverVC presentPopoverFromRect:frame   // did you forget to call this method?
                           inView:view
         permittedArrowDirections:UIPopoverArrowDirectionAny
                         animated:YES];
票数 6
EN
查看全部 14 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12540597

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档