How to prevent DoubleColumnNavigationView from being collapsed under ipad

Viewed 385
struct NavigationViewPadTest: View {

    var body: some View {
        NavigationView{
            List(0..<30){ i in
                Text("id:\(i)")
            }
            Text("abc")
            
        }
        .navigationViewStyle(DoubleColumnNavigationViewStyle())
    }
}

Use the above code to create a navigationView with a collapsible button at the top left of the screen. I don't want the navigationView to be collapsed and keep the DoubleColumn state. Is there a way to disable this button. enter image description here

thanks

1 Answers

The possible solution is to remove bar

demo

var body: some View {
    NavigationView{
        List(0..<30){ i in
            Text("id:\(i)")
        }
        .navigationBarHidden(true)    // << here !!

        Text("abc")
    }
    .navigationViewStyle(DoubleColumnNavigationViewStyle())
}
Related