我正在尝试使用UIDocumentPickerViewController从文件应用程序中一次导入/选择多个文件。
尝试设置allowsMultipleSelection = true,但仍然没有“选择”选项,而选择器则出现。
代码片段:
UIDocumentPickerViewController *dvc = [[UIDocumentPickerViewController alloc]initWithDocumentTypes:arrContents inMode:UIDocumentPickerModeImport];
dvc.delegate = self;
dvc.allowsMultipleSelection = true;
[self presentViewController:dvc animated:true completion:nil];截图:

发布于 2017-11-29 06:53:12
这是苹果需要解决的问题。你可以用这个解决办法。如果将animated:设置为YES,则只在第一次显示文档选择器时才能工作。
目标-C:
[self presentViewController:dvc animated:NO completion:^{
if (@available(iOS 11.0, *)) {
dvc.allowsMultipleSelection = YES;
}
}];Swift 4:
self.present(dvc, animated: false) {
if #available(iOS 11.0, *) {
dvc.allowsMultipleSelection = true;
}
}https://stackoverflow.com/questions/47053082
复制相似问题