UINavigationBar appearance in UISplitViewController detail on iPad

88 views Asked by At

I'm using UISplitViewController and customise the appearance of my UINavigationBar via UIAppearance and its working as expected for the most part.

I want to change the navigation to pure white (Red in the example for debugging reasons)

Only on iPad, the UINavigationBar of the detail of the SplitViewController seems to have an additional UIVisualEffectsView that changes the color of the NavigationBar. On iPhone, everything looks as expected...

This is how I set the Appearance in the AppDelegate

if #available(iOS 15.0, *) {
  let navigationBarAppearance = UINavigationBarAppearance()
  navigationBarAppearance.configureWithOpaqueBackground()
  navigationBarAppearance.shadowColor = .clear
  navigationBarAppearance.backgroundColor = .red
  UINavigationBar.appearance().standardAppearance = navigationBarAppearance
  UINavigationBar.appearance().compactAppearance = navigationBarAppearance
  UINavigationBar.appearance().scrollEdgeAppearance = navigationBarAppearance
  UINavigationBar.appearance().isTranslucent = false

}

Screenshot of the App displaying the color of the UINavigationBar

Screenshot of Reveal showing the UIVisualEffectsView

How can I remove the UIVisualEffectsView from the NavigationBar in the Detail and make it plain white?

0

There are 0 answers