After upgrading Xcode to Version 11.4 (11E146) on iOS 13.4 barTintColor only changes through the storyboard. In the code, changes are ignored.
self.navigationController.navigationBar.barTintColor = UIColor.redColor;
Also a problem with the color of the title.
Fixed in Xcode 11.4.1:
I was having the same issue, what fixed it for me was this:
On the storyboard, for your Navigation Controller change the "Bar Tint" to its "Default" value, then on your code you can change it as you normally would.
// For the navigation bar
navigationController?.navigationBar.barTintColor = .red
// For the title
let attributes = [NSAttributedString.Key.foregroundColor: UIColor.white ]
navigationController?.navigationBar.titleTextAttributes = attributes
I have the code in viewDidLoad()
Oddly enough for me, it also fixed the issue I was having with the "Status Bar".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With