Below you see the image and the black square i want to stretch to the red borders.
I have tried the following
import SwiftUI
struct ContentView : View {
var body: some View {
HStack(spacing: 1) {
Rectangle().frame(width:20).foregroundColor(.red).frame(width:20)
ScrollView {
VStack {
ForEach(0..<5) { index in
Rectangle().frame(minWidth: 50, maxWidth: .infinity, minHeight: 50, maxHeight: 50)
}
}.relativeWidth(1)
}
Rectangle().foregroundColor(.red).frame(width:20)
}
}
}
#if DEBUG
struct ContentView_Previews : PreviewProvider {
static var previews: some View { ContentView() }
}
#endif
but result is this: