支持UIDocumentInteractionController的横向和纵向方向

时间:2019-02-06 15:15:25

标签: ios swift uidocumentinteractioncontroller

我的IOS应用程序的方向已锁定为人像模式。但是,我想同时支持使用UIDocumentInteractionController打开的文件的横向和纵向方向。 这是我打开文件URL的代码。

 let url = URL.init(fileURLWithPath: fileURL)
        self.documentController = UIDocumentInteractionController.init(url: url)
        documentController!.delegate = self
        documentController!.presentPreview(animated: false)

对于使用上述代码打开的文件,如何实现纵向和横向定向,同时又将其他屏幕的纵向锁定为纵向? 非常感谢!

1 个答案:

答案 0 :(得分:0)

覆盖supportedInterfaceOrientations并应AutoRotate:

How to allow only single UIViewController to rotate in both Landscape and Portrait direction?。 Swift 3犹太版本

相关问题