我希望将我的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相同的背景颜色。仍然欢迎回答。