Ana*_*ore 13 objective-c ios uidocumentpickervc
我正在尝试使用文件应用程序一次导入/选择多个文件UIDocumentPickerViewController.
尝试设置,allowsMultipleSelection = true但在呈现选择器时仍然没有" 选择 "选项.
代码段:
UIDocumentPickerViewController *dvc = [[UIDocumentPickerViewController alloc]initWithDocumentTypes:arrContents inMode:UIDocumentPickerModeImport];
dvc.delegate = self;
dvc.allowsMultipleSelection = true;
[self presentViewController:dvc animated:true completion:nil];
Run Code Online (Sandbox Code Playgroud)
这是Apple需要修复的错误.您可以使用此解决方法.如果设置animated:为YES,则仅在您第一次显示文档选择器时才会起作用.
Objective-C的:
[self presentViewController:dvc animated:NO completion:^{
if (@available(iOS 11.0, *)) {
dvc.allowsMultipleSelection = YES;
}
}];
Run Code Online (Sandbox Code Playgroud)
斯威夫特4:
self.present(dvc, animated: false) {
if #available(iOS 11.0, *) {
dvc.allowsMultipleSelection = true;
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2313 次 |
| 最近记录: |