NavigationBar bar, tint, and title text color in iOS 8

前端 未结 18 2288
星月不相逢
星月不相逢 2020-12-02 04:08

The background text in the status bar is still black. How do I change the color to white?

// io8, swift, Xcode 6.0.1 
override func viewDidLoad() {
    super         


        
18条回答
  •  眼角桃花
    2020-12-02 04:35

    Swift 4.2 version of Albert's answer-

    UINavigationBar.appearance().barTintColor = UIColor(red: 234.0/255.0, green: 46.0/255.0, blue: 73.0/255.0, alpha: 1.0)
    UINavigationBar.appearance().tintColor = UIColor.white
    UINavigationBar.appearance().titleTextAttributes = [.foregroundColor : UIColor.white]
    

提交回复
热议问题