ios - Swift UIDocumentPickerViewController 没有像操作表弹出一样显示
问题描述
我正在尝试访问第三方云应用程序。我的应用程序上传按钮单击打开UIDocumentPickerViewController
并需要选择文件(单个或多个)然后我正在上传我的服务器。
上传按钮单击以
UIDocumentPickerViewController
打开全屏而不是像操作表一样打开。需要访问所有类型的文件。
在我的代码下面
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)
解决方案
推荐阅读
- react-native - React Native 抽屉式导航作为选项卡导航的一部分
- react-native - 获取中的异步行为?
- python - 合并两个集合并考虑每个集合的顺序(在 Python 中)
- ios - 如何将数据传递给父视图控制器
- excel - 当我有超过 100k 行数据时,Vlookup 函数运行时间过长:
- openedge - 未找到匹配时返回默认值
- java - OSGi getServiceReference 返回 null
- mysql - Mysql 用户无法通过 localhost 但从外部连接
- c# - 您如何将 ToDictionary 与 IEnumerable 一起使用
> 作为其中一种类型? - python - TypeError: expected string or bytes-like object - 如何使用 AWS 文档中提供的代码将文件复制到 S3 存储桶