在用紅線繪制的區域中可以看到白色。如果我更改最具包容性的 Vstack 的背景顏色,則該白色區域會更改。
洗掉 spacer() 行不起作用。
為什么即使中間沒有空間,也會有間隙?
struct TabbarView: View {
var body: some View {
VStack{
Spacer()
ZStack{
Color.orange.opacity(0.5)
VStack(spacing: 0){
Text("Home")
.padding()
}
}
Spacer()
HStack{
VStack{
Image(systemName: "homekit")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: UIScreen.main.bounds.size.width / 15, height: UIScreen.main.bounds.size.height / 25)
}
}
.frame(width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.height / 13)
.background(Color.purple)
}
.ignoresSafeArea()
// .background(Color.purple.shadow(radius: 2))
}
}

轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/465808.html
