【问题标题】:iOS14 missing buttons in "Save to Files" menuiOS14“保存到文件”菜单中缺少按钮
【发布时间】:2021-04-20 06:44:21
【问题描述】:

我发现我的代码在 iOS13 / iOS14 上的行为有所不同。我正在下载 pdf 文件并使用 UIDocumentInteractionController 显示它

     DispatchQueue.main.async {
        let controladorDoc = UIDocumentInteractionController(url: PdfUrl)
        controladorDoc.delegate = self
        controladorDoc.presentPreview(animated: true)
    }

显示 pdf 后,我单击“保存”按钮。区别如下:

缺少保存和取消按钮。如何解决?我正在考虑在操作菜单中重载按钮,但我没有找到如何实现。

【问题讨论】:

  • 它们是丢失了还是只是白色的?尝试点击按钮应该在的位置,看看是否有效。你在使用 UIAppearance 吗?
  • 嗨@EmilioPelaez 是的,这是我忘记添加的东西,它们似乎是白色的。当我点击角落时,它正在工作。我没有使用 UIAppearance。只有 UIDocumentInteractionController + 委托 documentInteractionControllerViewControllerForPreview(_ controller: UIDocumentInteractionController) -> UIViewController
  • UINavigationBar.appearance().tintColor = .white
  • @EmilioPelaez 我错了我在 AppDelegate 的一开始就使用 UIAppearance,代码行错误:UINavigationBar.appearance().tintColor = .white 请发表您的评论作为答案,我会将其标记为解决办法,谢谢!

标签: ios swift action ios14 uidocumentinteractioncontroller


【解决方案1】:

如果您的按钮正常工作但不可见,则很可能您在某处使用了UIAppearance,这导致您的按钮与导航栏颜色相同。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-01-08
    • 2017-10-29
    • 2016-08-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多