【问题标题】:Missing "Select" option to select multiple files in UIDocumentPickerViewController缺少“选择”选项以在 UIDocumentPickerViewController 中选择多个文件
【发布时间】:2021-09-25 23:20:13
【问题描述】:

有谁知道为什么在UIDocumentPickerViewController 中点击3 dots 时没有Select 选项,就像在Files app 中一样?即使 multipleSelection 设置为true
我注意到它出现在模拟器上,但没有出现在真实设备上。

private lazy var _documentPicker = UIDocumentPickerViewController(documentTypes: ["public.image",
         "public.audio",
         "public.movie",
         "public.text",
         "public.item",
         "public.content",
         "public.source-code"],
        in: .import)

private final func performDocumentsMenuOpen() {
        present(self._documentPicker, animated: true) {
            if #available(iOS 11.0, *) {
                self._documentPicker.allowsMultipleSelection = true
            } else {
                // Fallback on earlier versions
            }
        }
    }

【问题讨论】:

    标签: ios swift uidocumentpickerviewcontroller files-app


    【解决方案1】:

    修复者

    • 在展示 documentPicker 之前移动 allowsMultipleSelection = true
    • present(self._documentPicker, animated: true) 中将动画更改为 false

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-07-16
      • 1970-01-01
      • 1970-01-01
      • 2014-12-23
      • 2012-04-20
      相关资源
      最近更新 更多