I am experimenting with SwiftUI and just trying to have a button at the bottom. Right now it is centered. Wondering how I could force a view to stick superview's bottom as you would do in AutoLayout.
struct ContentView : View {
var body: some View {
VStack {
Text("Test")
}
}
}
Run Code Online (Sandbox Code Playgroud)
Thank you!!!
You have to add a Spacer view above the text.
struct ContentView : View {
var body: some View {
VStack {
Spacer()
Text("Test")
}
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
408 次 |
| 最近记录: |