SwiftUI SplitViewController Navigation Bar Color

I have a UISplitViewController (...using NavigationView and List) on iOS 15 using SwiftUI. The sidebar (master list) is blue background color, and the detail view pane (to the right) is white background.

On iPad landscape and portrait views, whenever I expand the sidebar for the first time its background color is correct (and matches the rest of the background color of the sidebar), but whenever I collapse the sidebar, and then open it again, the navigation bar is the background color that the detail view was.

Note all tests have been on the simulator thus far, so not sure this is a simulator thing or someone else has had the same problem.

Attached is the initial view on ipad landscape with the navigation bar (with no title) the correct background color. The other attached image is the after I've collapsed (hidden) the sidebar and then expanded it back to being shown again.

I've tried using the Introspect library to set the properties of the nav/splitview controller with:

.introspectNavigationController { controller in
        controller.navigationBar.tintColor = UIColor(Color.white)
        controller.navigationBar.standardAppearance.backgroundColor = UIColor(Color.blue)
        controller.navigationBar.standardAppearance.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor(Color.blue)]
      }

It's like the detail view's navigation bar background takes over for the background color of the sidebar.

Turned out to be one of the detail views (one that wasn't even selected to be displayed) had set the background color of the navigationBar to white, and somehow this only surfaced when I collapsed and then re-expanded the sidebar. Really strange.... 🤷‍♂️ but fixed now

SwiftUI SplitViewController Navigation Bar Color
 
 
Q