3

I have a tableViewController as my root view controller.

I've been trying to change the color of the status bar to match something like this:

enter image description here

However, when I set:

navigationController?.navigationBar.prefersLargeTitles = true

And apply:

override func viewDidAppear(_ animated: Bool) {
  navigationController?.navigationBar.barTintColor = UIColor.blue
  UINavigationBar.appearance().titleTextAttributes = [NSAttributedString.Key(rawValue: NSAttributedString.Key.foregroundColor.rawValue): UIColor.blue]
}

The background color doesn't change at all.

enter image description here

Only when I begin SCROLLING and the navigation bar collapses, do I get a color.

enter image description here

Has anyone else ran into this issue before? I built another viewController to test out "PrefersLargeTitles" WITHOUT a tableview scroll feature. And there was no background color either.

Wallace
  • 107
  • 4

0 Answers0