The new iOS 15 navigation bars are translucent when scrolled to the top by default. Because I am showing a UIMapView, I don't want this behaviour for this particular ViewController, while keeping this new behaviour for the rest of the app.
I have navigationItem.largeTitleDisplayMode set to .never.
override func viewDidLoad() {
super.viewDidLoad()
if #available(iOS 15.0, *) {
let appearance = UINavigationBarAppearance()
appearance.configureWithDefaultBackground()
self.navigationItem.scrollEdgeAppearance = appearance
}
}
But this results in the navigation bar showing the it's background as if the large title is still showing. Setting the navigationItem.largeTitleDisplayMode to .always and back to .never doesn't fix it.
I am only able to reproduce this behaviour when the UINavigationController is wrapped in a UISplitViewController like this:
When reproducing this without the UISplitViewController, with just the UINavigationController -> UIViewController with button -> UIViewController with UIMapView, the UINavigationBar functions just fine.
Strangely, when running this example on iOS 14, the UINavigationBar's appearance is just fine, but I am unable to interact with the map in the area that is covered when running on iOS 15. (See https://youtu.be/XqbzOimhqGA)
What am I doing wrong here? Or is this an iOS bug?
My testing project that I used can be found on GitHub: Zandor300/iOS15NavigationBar

