title: SwiftUI VStack spacing: not working properly
body: <p>I have a SwiftUI VStack that sits inside a scrollView, a Geometry reader and a NavigationView, here is the code:</p>
  
  <pre><code>struct RezeptList: View {
  
      @Environment(\.colorScheme) var colorScheme: ColorScheme
      @EnvironmentObject private var recipeStore: RecipeStore
  
      @State private var searching = false
      @State private var searchText = ""
      @State private var showingAddRecipeView = false
  
      var body: some View {
          NavigationView{
              GeometryReader { geo in
                  ScrollView {
                      SearchBar(searchText: self.$searchText, isSearching: self.$searching)
                      VStack(spacing: 30) {
  
                          ForEach(self.recipeStore.recipes.filter{$0.name.hasPrefix(self.searchText) || self.searchText == ""}) {recipe in
                              NavigationLink(destination:
                              RezeptDetail(recipe: recipe).environmentObject(self.recipeStore)) {
                                  Card(rezept: recipe,width: geo.size.width - 20)
                              }
                              .buttonStyle(PlainButtonStyle())
                          }
  
                          .navigationBarItems(trailing: Button(action: {
                              self.showingAddRecipeView = true
                          }){
                              Image(systemName: "square.and.pencil")
                                  .foregroundColor(.primary)
                              }
                          .padding()
                          )
                      }
                      .padding(.bottom)
                      .navigationBarTitle("Rezepte")
                      .sheet(isPresented: self.$showingAddRecipeView) {
                          AddRecipeView(isPresented: self.$showingAddRecipeView)
                              .environmentObject(self.recipeStore)
                      }
                  }
              }
          }
      }
  
      init() {
          UINavigationBar.appearance().tintColor = UIColor.label
      }
  
  }
  </code></pre>
  
  <p>But it looks like this no matter the amount of spacing:
  <a href="https://i.stack.imgur.com/8cllt.png" rel="nofollow noreferrer">Image</a></p>
  
  <p>But I noticed when I move the .navigationBarItems modifiers it works but then as soon as you tap on the navigationLink the app crashes.</p>