我想将 DocumentPicker 的导航栏背景颜色设置为与我的应用程序的其余部分相同。
let filePicker = UIDocumentPickerViewController(documentTypes: ["public.content"], in: .import)
filePicker.delegate = self
filePicker.navigationController?.navigationBar.barTintColor = self.theme.navigationBarColor
self.present(filePicker, animated: true, completion: nil)
不起作用。
我尝试过的其他事情:
使用UINavigationBar.appearance().backgroundColor = self.theme.navigationBarColor
- 不起作用,并且看起来太像一种解决方法,而不是一种正确的方法(如果它有效)。
编辑:现在我们的应用程序重新设计为使用原色作为导航栏文本颜色,并具有与 DocumentPicker 相同的背景颜色。答案仍将不胜感激。