我的应用程序使用带有白色按钮和文本的红色导航栏(2)栏.当我使用系统联系人选择器(3)时,状态栏为红色.当我使用文件选择器(1)时,UIDocumentPickerViewController导航栏是白色的.如何更改导航栏或文本的颜色?
当我使用下面的代码时,它可以工作,但它也改变了我的导航栏.
UINavigationBar.appearance().tintColor = .red
Run Code Online (Sandbox Code Playgroud)
感谢帮助
码:
func open() {
UINavigationBar.appearance().barTintColor = .green
let documentsController = UIDocumentPickerViewController(documentTypes: makeDocumentTypesList(), in: .import)
documentsController.delegate = self
viewControllerProvider.getViewController().present(documentsController, animated: true, completion: nil)
}
Run Code Online (Sandbox Code Playgroud)