Is there a way with SwiftUI to align content directly to the top of a sheet instead of in the middle?
My sheet is just a simple Text
view.
CodePudding user response:
Use a spacer to move it at top, like
VStack {
Text("Your text")
Spacer() // << here !!
}
CodePudding user response:
You can try this way beside Spacer() too:
VStack {
Text("Hello World!")
.frame(maxHeight: .infinity, alignment: .top)
}