I'm having trouble figuring out why there's some spacing below my text.
struct testView: View {
@State private var notes = ""
var body: some View {
VStack {
Text("Larg Text").font(.system(size: 70))
.background(Color.red)
TextField("Add a note", text: $notes)
.background(Color.red)
Spacer()
}
.background(Color.yellow)
}
}
For some reason, there's this mysterious space between Text and TextField. This space seems to decrease if I
- Decrease the font size
- Do not specify a font size
- Don't use a TextField after Text view
- Don't use a Text view before TextField
In other words, this font size–dependent spacing seems to only happen between Text and TextField. I'm utterly confused. I'd like to get rid of this space.
Appreciate your help!
