I'm trying to create a macos app and wanted to play with SwiftUI. My goal is a window with 4 lists arranged horizontally across the top, and the lower half as TextEditor. My attempt at this was:
struct ContentView: View {
@State private var fullText: String = "Bazinga"
var body: some View {
VSplitView() {
HSplitView() {
List() {
Text("Alpha")
Text("Bravo")
Text("Charlie")
}
List() {
Text("Protons")
Text("Electrons")
Text("Neutrons")
}
List() {
Text("Blueberries")
Text("Strawberries")
Text("Cherries")
}
List() {
Text("Ford")
Text("Chevy")
Text("Dodge")
}
}
TextEditor(text: $fullText)
.lineSpacing(2)
}
}
}
What I see when I open the window initially though is:
What do I change to get the 4 lists to be evenly distributed across the top? It manages to show both the TextEditor and the upper half, but only one of the 4 lists.
I note that the drag bars are there on the edge, and I can drag them to get the layout desired:
So my real question is how do I get to look like this initially?