简体   繁体   English

支持UIDocumentInteractionController的横向和纵向方向

[英]Support landscape and portrait orientation for UIDocumentInteractionController

The orientation of my IOS app has been locked to Portrait mode. 我的IOS应用的方向已锁定为人像模式。 However, I want to support both landscape and portrait orientation for files that open using UIDocumentInteractionController. 但是,我想同时支持使用UIDocumentInteractionController打开的文件的横向和纵向方向。 Here is my code to open a file url. 这是我打开文件URL的代码。

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

How do I achieve portrait and landscape orientation for files that open using the above code while also locking down the orientation to portrait for other screens? 如何在使用上述代码打开的文件中实现纵向和横向方向,同时又将其他屏幕的方向锁定为纵向? Thanks so much! 非常感谢!

Override supportedInterfaceOrientations and shouldAutoRotate: 覆盖supportedInterfaceOrientations,并应AutoRotate:

How to allow only single UIViewController to rotate in both Landscape and Portrait direction? 如何只允许单个UIViewController沿横向和纵向旋转? . Swift 3 Kosher Version Swift 3犹太版本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM