【发布时间】:2019-10-04 18:12:14
【问题描述】:
我正在使用 UIDocumentPickerViewController 浏览并让用户选择一个目录,但在 iOS 13 上,当显示此 UIDocumentPickerViewController 时,不显示应该显示的按钮,如选择/取消和打开/完成,但是当你点击它时location 它的行为就像按钮可见时的行为一样。此外,此问题仅在 iOS 13 上出现。使用相同的代码,按钮显示在 iOS 12 上。感谢任何帮助
对于 AppDelegate didFinishLaunchingWithOptions 中的 UIDocumentBrowserViewController 实例,我确实将导航栏的色调颜色设置为 nil。
if #available(iOS 11.0, *) {
UINavigationBar.appearance(whenContainedInInstancesOf: [UIDocumentBrowserViewController.self]).tintColor = nil
}
//Here is how UIDocumentPickerViewController is created and presented
let documentPickerViewController = UIDocumentPickerViewController(documentTypes:["public.folder"], in: .open)
...
...
...
self!.documentPickerViewController.delegate = self!
self!.documentPickerViewController.allowsMultipleSelection = true
self!.documentPickerViewController.modalPresentationStyle = .fullScreen
self!.navigationController?.present(self!.documentPickerViewController, animated: true, completion:nil)
编辑: 这是视图层次结构-不知道为什么在 iOS 13 上使用 DOCExportModeViewController。在 iOS 12 上,它是相同代码的 UIDocumentBrowserViewController。有什么想法可以解决这个问题吗?
【问题讨论】:
-
我在浅色模式下观察到这种行为,按钮似乎在那里,但白底白字,因此不可见。这就是为什么他们仍然通过了解自己的位置来工作。
标签: ios swift xcode ios13 uidocumentpickerviewcontroller