【发布时间】:2014-08-01 23:36:55
【问题描述】:
如果我添加一个可以从iPad 访问我的照片库的弹出框,系统总是会崩溃并显示以下消息:
由于未捕获的异常“UIApplicationInvalidInterfaceOrientation”而终止应用程序,原因:“支持的方向与应用程序没有共同的方向,并且 [PUUIAlbumListViewController shouldAutorotate] 返回 YES”
但我已经在我的 Projekt 信息中进行了设置,只是为了支持横向模式。
所以我添加了以下功能
override func shouldAutorotate() -> Bool {
return false
}
可是我不知道怎么用?如果我也在我的应用程序上启用UIInterfaceOrientationPortrait,它工作正常。但我不想支持UIInterfaceOrientationPortrait。
我会这样称呼我的弹出框:
var popover: UIPopoverController = UIPopoverController(contentViewController: ImagePickerController)
popover.presentPopoverFromBarButtonItem(addImageButton,
permittedArrowDirections: UIPopoverArrowDirection.Any,
animated: true)
任何帮助将不胜感激
【问题讨论】:
标签: ios swift uipopovercontroller uiinterfaceorientation shouldautorotate