I have a view with a HSplitView containing three sub-views, a central panel that contains toggles to hide / show a left and right side pane. If I hide any side panel, the central panel does not redraw correctly.
A slight nudge on the app will make it redraw correctly. The toggles do not work until you have triggered a redraw, I guess internally they are at the "new" location but visually at the "old".
With HStack instead of HSplitView everything works as expected. Here is a simplified example of the code, any suggestions ...
A slight nudge on the app will make it redraw correctly. The toggles do not work until you have triggered a redraw, I guess internally they are at the "new" location but visually at the "old".
With HStack instead of HSplitView everything works as expected. Here is a simplified example of the code, any suggestions ...
Code Block var body: some View { // HSplitView does not work, HStack work OK HSplitView { if showLeftPane { Text("Left pane").frame(minWidth: 200, idealWidth: 200, maxHeight: .infinity, alignment: .topLeading).background(Color.yellow) } VStack { Toggle("Left show", isOn: $showLeftPane) Toggle("Right show", isOn: $showRightPane) }.frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.green) if showRightPane { Text("Right pane").frame(minWidth: 200, idealWidth: 200, maxHeight: .infinity, alignment: .topLeading).background(Color.blue) } }