gpt4 book ai didi

ios - Swift UIDocumentPickerViewController 不像操作表弹出窗口那样显示

转载 作者:行者123 更新时间:2023-11-30 11:15:34 24 4
gpt4 key购买 nike

我正在尝试访问第三方云应用程序。我的应用程序上传按钮单击打开 UIDocumentPickerViewController 并需要选择文件(单个或多个),然后我上传我的服务器。

  1. 上传按钮点击UIDocumentPickerViewController打开全屏而不是像操作表一样打开。

  2. 需要访问所有类型的文件。

下面是我的代码

let importMenu = UIDocumentPickerViewController(documentTypes: ["public.text", "com.apple.iwork.pages.pages", "public.data"], in: .import)
importMenu.delegate = self
importMenu.modalPresentationStyle = .formSheet
if let popoverPresentationController = importMenu.popoverPresentationController {
popoverPresentationController.sourceView = self.view;
//popoverPresentationController.sourceView = sender as? UIView
//popoverPresentationController.sourceRect = sender.bounds
}
self.present(importMenu, animated: true, completion: nil)

最佳答案

检查文档,您的答案位于下图中。 enter image description here

关于ios - Swift UIDocumentPickerViewController 不像操作表弹出窗口那样显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51784013/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com