Я пытаюсь получить два представления в HStack, используя SwiftUI. Тем не менее, я продолжаю получать разрыв между двумя взглядами. Проблема возникает как в книжной, так и в альбомной ориентации.
мой код:
struct ContentView: View {
var body: some View {
GeometryReader { g in
HStack {
GeometryReader { g in
HStack {
VStack {
Text("View One")
}
.frame(width: g.size.width * 0.5, height: g.size.height, alignment: .center)
.background(Color.blue)
VStack {
Text("View Two")
}
.frame(width: g.size.width * 0.5, height: g.size.height, alignment: .center)
.background(Color.red)
}
}
}
}
}
}
