【发布时间】:2019-01-31 23:58:37
【问题描述】:
我正在尝试自定义 iOS 上默认 Firebase AuthUI 屏幕的配色方案。我可以更改 NavigationBar 文本颜色,但不能更改左侧 LeftNavigationBarItem 文本属性或主视图背景颜色。
这是我用来更改 NavigationBar 上主要文本属性的代码:
let authVC = authUI!.authViewController()
authVC.navigationBar.barTintColor = UIColor.black
authVC.navigationBar.barStyle = .blackTranslucent
authVC.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor: UIColor (displayP3Red: 255/255, green: 212/255, blue: 121/255, alpha: 1.0)]
我尝试了以下代码,一次一行,来更改 NavigationBarItem 文本属性:
authVC.navigationBar.backItem?.backBarButtonItem?.setTitleTextAttributes([NSAttributedStringKey.foregroundColor: UIColor (displayP3Red: 255/255, green: 212/255, blue:121/255, alpha: 1.0) ], for: .normal)
authVC.navigationItem.backBarButtonItem?.setTitleTextAttributes([NSAttributedStringKey.foregroundColor: UIColor (displayP3Red: 255/255, green: 212/255, blue: 121/255, alpha: 1.0) ], for: .normal)
我已经尝试过更改视图背景属性,一次又是一行:
authVC.visibleViewController?.view.backgroundColor = UIColor.black
authVC.view.backgroundColor = UIColor.black
authVC.view.layer.backgroundColor = UIColor.black.cgColor
authVC.visibleViewController?.view.layer.backgroundColor = UIColor.black.cgColor
我正在使用 FirebaseUI (5.2.0)、FirebaseAuth (5.0.3) 和 Xcode 9.4.1。
任何指针将不胜感激。
谢谢
【问题讨论】:
标签: firebase firebase-authentication firebaseui