I want part of my view to be wrapped inside a Form
, but not the whole thing. I don't want the Form
to take up that much space, so I've shrunken it using .frame()
. Although there is still a lot of margin on top of the Form. Here's my code.
struct ContentView: View {
var body: some View {
NavigationView {
ScrollView {
VStack {
Form {
Text("Some text in a form")
}
.frame(width: 400, height: 90) // shrinks Form size, but doesn't remove margin
Text("Some more text")
}
}
}
}
}
The .frame()
height doesn't seem to remove that extra space at the top of the Form (light grey area).
I've also tried adding .listRowInsets(EdgeInsets())
to the first Text
view, but that doesn't remove the top margin. Any ideas?