title: Screen Background Color With ScrollView And Navigation Bar SwiftUI
body: <p>Im trying to have a colored background while using a scrollview with SwiftUI but this causes the navigation title to no longer collapse. I've tried a number of ways yet this is always an issue.</p>
  
  <pre><code>struct Person : Identifiable{
      var id : Int
      var name : String
  }
  
  struct ContentView: View {
      let people = [
          Person(id: 1, name: "Ricky"),
          Person(id: 2, name: "Dani"),
          Person(id: 3, name: "Mark"),
          Person(id: 4, name: "Kailin"),
          Person(id: 5, name: "James"),
          Person(id: 5, name: "Jenna")
      ]
  
      var body: some View {
          NavigationView{
              ZStack{
                  Color.red
                      .edgesIgnoringSafeArea(.all)
                  ScrollView{
                      ForEach(people, id: \.id) { person in
                          Text(person.name)
                              .frame(width: 300, height: 400)
                              .background(Color.blue)
                              .padding()
                      }
                  }.navigationBarTitle("Home")
              }
          }
      }
  
      //    init(){
      //        UIView.appearance().backgroundColor = .orange
      //    }
  }
  </code></pre>