我正在开发一个仅支持横向定位的应用程序 . 它使用 UIImagePickerController
从库中选择图像和/或视频 . 应用程序在iOS-5或之前运行良好但在我尝试呈现图像选择器控制器时它会崩溃 . 它在崩溃后给出以下消息:
*因未捕获的异常终止应用'UIApplicationInvalidInterfaceOrientation',原因:'Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES'
2 回答
正如@rocky所说,你必须将Potrait模式添加到你的应用程序才能使用
UIImagePickerController
就像这样或将此添加到仅限景观的应用委托类
从Mr.Daniel's Answer我找到了一个很好的解决方案,你的仅景观应用程序,因为你只需要支持你的应用程序的景观,你只需要添加一个类别
UINavigationController
像这样并将其添加到您的viewControllers,它适用于我 .
来自UIImagePickerController文档:
如果要使用此控制器,则必须将“纵向”模式添加到“支持”界面方向 .