Dakata
Dakata

Reputation: 1355

How to change the color of a NavigationBar?

I am trying to change the color of the text "Welcome" in the Navigation Bar. As you see now it is blue and I want to change it to white as the rest of the text in the Navigation Bar.

Would you give me any ideas? I tried to add some code and it is working, because the clock was black and now is white, like it should be, but the "Welcome" is still staying in blue.

enter image description here

Upvotes: 0

Views: 48

Answers (1)

Shayan Jalil
Shayan Jalil

Reputation: 588

Put this code in either your app delegate in the didFinishLaunchingWithOptions method, or in your navigationController's custom class

let customColor = UIColor.redColor()
UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName:customColor]
UINavigationBar.appearance().tintColor = customColor

Upvotes: 1

Related Questions