我的 IOS 应用程序的方向已锁定为纵向模式。但是,我想支持使用 UIDocumentInteractionController 打开的文件的横向和纵向。 这是我打开文件 url 的代码。
let url = URL.init(fileURLWithPath: fileURL)
self.documentController = UIDocumentInteractionController.init(url: url)
documentController!.delegate = self
documentController!.presentPreview(animated: false)
如何实现使用上述代码打开的文件的纵向和横向方向,同时将其他屏幕的方向锁定为纵向? 非常感谢!
最佳答案
覆盖supportedInterfaceOrientations和shouldAutoRotate:
How to allow only single UIViewController to rotate in both Landscape and Portrait direction? 。 Swift 3 犹太版本
关于ios - UIDocumentInteractionController 支持横向和纵向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54556831/