Navigation Bar is transparent swift 5

Viewed 433

When I updated to Xcode 11 all my NavigationBar have become transparent (Transparent bar photo). Why, I didn't change any code after the update?

1 Answers

This is the new behavior of iOS 13 as it is mentioned here:

In iOS 13 and later, a large title navigation bar doesn’t include a background material or shadow by default.

You can still override this behavior:

let appearance = UINavigationBarAppearance()
appearance.backgroundColor = .white
self.navigationController?.navigationBar.scrollEdgeAppearance = appearance
Related