操作/选项菜单在第一次启动时不可见,当我进入全屏模式并返回正常模式时会出现。附上截图供参考。我究竟做错了什么?这是代码:
let docController = UIDocumentInteractionController(url: url!)
docController.delegate = self
docController.presentPreview(animated: true)
和委托方法:
override func documentInteractionControllerViewControllerForPreview(_ controller: UIDocumentInteractionController) -> UIViewController {
return self.navigationController!
}
答案 0 :(得分:0)
试试这个,它对我有用
let docPrev:UIDocumentInteractionController = UIDocumentInteractionController.init(url: url!)
docPrev.delegate = self
docPrev.presentPreview(animated: true)
委托方法:
func documentInteractionControllerViewControllerForPreview(_ controller: UIDocumentInteractionController) -> UIViewController {
return self
}
答案 1 :(得分:0)
请访问以下链接: Opening a file by UIDocumentInteractionController
上述链接的答案表明,在委托方法中,您需要返回“自我”。这与Jigar提到的相同。以上链接建议如下链接可能对您有所帮助