0

I have a UINavigationBar with preferedLargesTitles = true. I tried everything but i can't change from white the top navigationBar color. enter image description here

Godfather
  • 4,040
  • 6
  • 43
  • 70

3 Answers3

1

You should be able to change the text colour of the bar button items using the tintColor property

override func viewDidLoad() {
    super.viewDidLoad()

    self.title = "Testing"
    navigationController?.navigationBar.prefersLargeTitles = true
    navigationController?.navigationBar.tintColor = .red
}

enter image description here

Scriptable
  • 19,402
  • 5
  • 56
  • 72
0

largeTitleTextAttributes will do the job!

here is a sample:

navigationController?.navigationBar.largeTitleTextAttributes = [NSAttributedStringKey.foregroundColor: UIColor.gray]
Alastar
  • 1,284
  • 1
  • 8
  • 14
0

navigationController.navigationBar.tintColor = .whatever do the trick!

Godfather
  • 4,040
  • 6
  • 43
  • 70