Complete the code to create a vertical stack of two Text views.
VStack {
Text("Hello")
[1]("World")
}The VStack arranges views vertically. To add a second text, use Text again.
Complete the code to create a horizontal stack with two Text views.
HStack {
Text("Left")
[1]("Right")
}Inside an HStack, each child is a view. To add text, use Text.
Fix the error in the code to overlay two Text views using ZStack.
ZStack {
Text("Back")
[1]("Front")
}ZStack overlays views. To add the front text, use Text.
Fill both blanks to create a VStack containing an HStack and a ZStack.
VStack {
[1] {
Text("Left")
Text("Right")
}
[2] {
Text("Bottom")
Text("Top")
}
}The VStack contains an HStack for horizontal layout and a ZStack for overlay.
Fill the blanks to create a ZStack with a VStack and an HStack inside.
ZStack {
[1] {
Text("Top")
Text("Bottom")
}
[2] {
Text("Left")
Text("Right")
}
Text("Center")
}The ZStack overlays a VStack, an HStack, and a centered Text.
