Can someone explain why:
GeometryReader positions its contents to the left top corner, not in the center.
GeometryReader takes up all available space.
struct ContentView: View {
var body: some View {
VStack(alignment: .center) {
GeometryReader { geo in
Text("Hello, World!")
.frame(width: geo.size.width * 0.7, height: 40)
.background(Color.red)
}
.background(Color.yellow)
Text("More text")
.background(Color.blue)
}
}
}
This is how it looks:
I would expect it to position Text "Hello, World" view in the center.
