title: Fill height in scrollView in swiftUI
body: <p>I am coding useing swiftUI and I have a vertical <code>scrollView</code> (see screenshots), and inside that <code>scrollView</code> I have another horizontal <code>scrollView</code>, and below that I have a <code>VStack</code> that I want the height to fill the rest of the screen to the bottom of the vertical <code>scrollView</code>, but I can't seem to make it work.</p>
  <p>The content in the vertical <code>scrollView</code> can be larger than the actually remaining space in some cases that is why I need a scrollView, but in some other cases the content is smaller than the remaining space</p>
  <p>Here is the code I have :</p>
  <pre><code>    VStack {
          HeaderView
          
          ScrollView(.vertical, showsIndicators: false) {
              FriendsHorizontalScrollView()
              
              VStack {
                  // I want this view to take all the remaining height left in the scrollView
                  FullHeightView()
              }
              .frame(width: UIScreen.main.bounds.width)
          }
      }
  </code></pre>
  <p>What I end up having is something like this :</p>
  <p><a href="https://i.stack.imgur.com/zgIF9.png" rel="noreferrer"><img src="https://i.stack.imgur.com/zgIF9.png" alt="enter image description here" /></a></p>
  <p>What I want to have :</p>
  <p><a href="https://i.stack.imgur.com/in4Bt.png" rel="noreferrer"><img src="https://i.stack.imgur.com/in4Bt.png" alt="enter image description here" /></a></p>
  <p>I have tried several solutions like using geometryReader or putting <code>.frame(maxHeight: .infinity)</code> on the <code>VStack</code> but nothing seems to work properly.</p>