title: Make ScrollView content fill its parent in SwiftUI
body: <p>I'd love to build a scrolling screen, so I wanted to embed it <code>ScrollView</code>. But I am not able to achieve it the view just shrinks to its compressed size. Let's say that I want the <code>ScrollView</code> to scroll vertically so I'd love the content to match scrollView's width. So I use such preview:</p>
  
  <pre><code>struct ScrollSubview_Previews : PreviewProvider {
      static var previews: some View {
          func textfield() -&gt; some View {
              TextField(.constant("Text")).background(Color.red)
          }
  
          return Group {
              textfield()
              ScrollView {
                  textfield()
              }
          }
      }
  }
  </code></pre>
  
  <p>But it ends with result like this:</p>
  
  <p><a href="https://i.stack.imgur.com/JFlCf.png" rel="noreferrer"><img src="https://i.stack.imgur.com/JFlCf.png" alt="enter image description here"></a></p>