title: SwiftUI Navigation View Margins Around List
body: <p>I have a SwiftUI app with a Navigation View.  Inside that Navigation View is a List.  The List contains Navigation Links.  Everything works fine, but I'd like each List item to stretch out to the full width of the view and not have that gray margin all the way around it.</p>
  <p><strong>How do I make the List the full width and also eliminate top margin?</strong></p>
  <pre><code>import SwiftUI
  
  struct ConsumerDashboardView: View {
  
  @StateObject var authVM = AuthorizationClass()
  
  var body: some View {
      NavigationView {
          VStack{
              Spacer()
                  .frame(height: 50)
              Button(action: {
                  print(&quot;Button Clicked&quot;)
              }){
              Text(&quot;\(Image(systemName: &quot;plus&quot;)) Start a New Project&quot;)
                  .font(.headline)
                  .fontWeight(/*@START_MENU_TOKEN@*/.bold/*@END_MENU_TOKEN@*/)
                  .foregroundColor(.white)
                  .padding()
                  .frame(width: 300, height: 60)
                  .background(Color(&quot;BrandOrange&quot;))
                  .cornerRadius(5.0)
              }
              Spacer()
                  .frame(height: 100)
              VStack(spacing: -2){
                  HStack{
                      Text(&quot;  Active\nProjects&quot;)
                          .font(.headline)
                          .fontWeight(/*@START_MENU_TOKEN@*/.bold/*@END_MENU_TOKEN@*/)
                          .frame(
                              width: 120,
                              height: 60,
                              alignment: .center
                          )
                          .background(Color(&quot;BrandLightBlue&quot;))
                          .foregroundColor(.white)
                          .padding(.trailing, 50)
                      Text(&quot; Closed\nProjects&quot;)
                          .font(.headline)
                          .fontWeight(/*@START_MENU_TOKEN@*/.bold/*@END_MENU_TOKEN@*/)
                          .frame(
                              width: 120,
                              height: 60,
                              alignment: .center
                          )
                          .border(Color(&quot;BrandLightBlue&quot;), width: 2)
                          .background(Color(.white))
                          .foregroundColor(Color(&quot;BrandLightBlue&quot;))
                  }
                  Divider()
                      .frame(
                          width: 1000,
                          height: 3
                      )
                      .background(Color(&quot;BrandLightBlue&quot;))
                  Spacer()
                      if !authVM.projectObjects.isEmpty {
                          ProjectsList(authVM: authVM)
                      } else {
                          ProjectsLoader(authVM: authVM)
                      }
                  }
              }
              .navigationBarTitleDisplayMode(.inline)
              .toolbar {
                  ToolbarItem(placement: .principal) {
                      HStack {
                          Image(&quot;Icon&quot;)
                              .resizable()
                              .frame(
                                  width: 30,
                                  height: 30
                              )
                          Text(&quot;Icon&quot;).font(.headline)
                          Image(systemName: &quot;line.3.horizontal.decrease.circle&quot;)
                              .imageScale(.large)
                      }
                  }
              }
      }.onAppear {
          authVM.fetchProjects()
      }
  }
  }
  
  struct ProjectsList: View {
  
  @StateObject var authVM = AuthorizationClass()
  
  var body: some View {
          List(authVM.projectObjects){ projectObject in
              NavigationLink(destination: ProjectDetailView(project: projectObject.project)){
                  ProjectRowView(project: projectObject.project)
                      .frame(
                          height: 150
                      )
              }
          }
  }
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/W6CeR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W6CeR.png" alt="enter image description here" /></a></p>