相关疑难解决方法(0)

UIDocumentPickerViewController - 如何设置导航栏颜色

我想将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)
Run Code Online (Sandbox Code Playgroud)

不起作用.

我试过的其他事情:

使用UINavigationBar.appearance().backgroundColor = self.theme.navigationBarColor- 不起作用,看起来太像一个变通方法而不是一个正确的方法,如果它的工作原理.

编辑:现在我们的应用程序被重新设计为使用主要颜色作为导航栏文本颜色,并具有与DocumentPicker相同的背景颜色.答案仍将受到赞赏.

ios swift uidocumentpickervc

10
推荐指数
1
解决办法
1712
查看次数

标签 统计

ios ×1

swift ×1

uidocumentpickervc ×1