title: iOS 15 navigation bar transparency problem with TabView
body: <p>New iOS 15 makes navigation bar background completely transparent if there is no element behind, if there is a List and you scroll the elements to be behind the navigation bar this obtains a white translucent background, but if I use a TabView where every TabItem have a List inside the navigation bar background did not update correctly when switching between tab items, the navigation bar keep always transparent background.</p>
  <p>Im using SwiftUI and my basic code looks like this:</p>
  <pre><code>struct Main: View {
      var body: some View {
          WindowGroup {
              NavigationView {
                  TabView {
                      TabElement()
                      TabElement()
                      TabElement()
                      TabElement()
                      TabElement()
                  }.navigationBarTitle(Text(&quot;Main&quot;), displayMode: .inline).navigationBarBackButtonHidden(true)
              }
          }
      }
  }
  
  struct TabElement: View {
      var body: some View {
          VStack {
              List {
                 Text(&quot;empty&quot;)
                 Text(&quot;empty&quot;)
                 Text(&quot;empty&quot;)
                 Text(&quot;empty&quot;)
                 Text(&quot;empty&quot;)
                 Text(&quot;empty&quot;)
                 Text(&quot;empty&quot;)
                 Text(&quot;empty&quot;)
                 Text(&quot;empty&quot;)
                 Text(&quot;empty&quot;)
             }.listStyle(InsetGroupedListStyle())
          }.tabItem {
              Image(systemName: &quot;star.fill&quot;)
              Text(&quot;dummy&quot;)
          }
      }
  }
  </code></pre>
  <p>So, this code makes a tabed view with five tabs, each tab have a list of ten Text views, if I switch to any other tab and scroll the elements to the top, the list can be seen through navigation bar instead of behind.</p>
  <p><a href="https://i.stack.imgur.com/XxOpg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XxOpg.png" alt="enter image description here" /></a></p>
  <p>What is causing this behavior? It's some kind of bug or my code is wrong? This problem is not happening in iOS 14.* since navigation bar always have white background.</p>
  <p><strong>NOTE:</strong>
  I found that it is possible to use:</p>
  <pre><code>if #available(iOS 15, *) {
      let appearance = UINavigationBarAppearance()
      appearance.configureWithOpaqueBackground()
      UINavigationBar.appearance().standardAppearance = appearance
      UINavigationBar.appearance().scrollEdgeAppearance = appearance
  }
  </code></pre>
  <p>...in my <code>ApDelegate</code> but it's look like a tricky way to get rid of the transparency in navigation bar. If Apple decide to use this new design in iOS 15 I wanna implement it in my app, but only if the transparency update correctly.</p>