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