答案 0 :(得分:1)
我知道您不要求使用空格,但是此代码显示您可以使用它们而无需将徽标放在屏幕顶部。或者,您可以使用“ .position(CGPoint(...))”
struct ContentView: View {
var body: some View {
VStack {
Spacer()
VStack (alignment: .center) {
Image("your-image").resizable().frame(width: 90, height: 95)
Text("TCheck time").font(.title).foregroundColor(.gray)
}.padding()
Spacer()
HStack (alignment: .bottom) {
Text("2020 SplitWay").font(.subheadline).foregroundColor(.gray)
}
}
}
}
答案 1 :(得分:1)
这是不使用Spacer的解决方案:
struct ContentView: View {
var body: some View {
VStack {
VStack {
Text("Image")
Text("Some text")
}.frame(minHeight: 0, maxHeight: .infinity)
HStack {
Text("Bottom")
}
}
}
}