0

I have a TabView with four tabitems which destinations are four NavigationSplitView. The Sidebar button is repeating for the four NavigationSplitViews on macOS like on below display. On iPad it works properly. How to fix the Sidebar button to display only one related to the NavigationSplitView selected in the TabView. Xcode 14.2, MacOS 13.2. Thanks

enter image description here

struct ContentView: View {
    
    var body: some View {
        TabView() {
            Tab1View().tabItem { Label("Tab1", systemImage: "star")}
            Tab2View().tabItem { Label("Tab2", systemImage: "star")}
            Tab3View().tabItem { Label("Tab3", systemImage: "star")}
            Tab4View().tabItem { Label("Tab4", systemImage: "star")}
        }
    }
}

struct Tab1View: View {
    var body: some View {
        NavigationSplitView {
            Text("Tab1")
        }detail: {
            Text("Detail Tab1")
        }
        .navigationSplitViewStyle(.automatic)
    }
# Tab2View, Tab3View, Tab4View like Tab1View

JYF97411
  • 1
  • 1

0 Answers0