.navigationViewStyle(.columns) doesn't work

Hi, I'm trying to do basic app with fixed Navigation View on iPad. Doesn't work. What am I doing wrong?

import SwiftUI



struct CollectionView: View {

    var body: some View {

        if #available(iOS 15.0, *) {

            NavigationView {

                

                Text("Hello")

                

                    .navigationTitle("Hello")

            }

            .navigationViewStyle(.columns)

            .padding()

        } else {

            // Fallback on earlier versions

        }

    }

}



struct CollectionView_Previews: PreviewProvider {

    static var previews: some View {

        CollectionView()

    }

}

Can you clarify what you mean by fixed Navigation View?

Anyway, you may need to define at least two columns inside NavigationView to test how .columns work.

A simple example:

struct CollectionView: View {
    var body: some View {
        if #available(iOS 15.0, *) {
            NavigationView {
                //First column
                VStack {
                    NavigationLink(destination:
                        //Second column replacement
                        Text("Hello")
                            .navigationBarTitle("Hello")
                    ) {
                        Text("To hello")
                    }
                }
                    .navigationBarTitle("List", displayMode: .large)
                //Second column
                EmptyView()
            }
            .navigationViewStyle(.columns)
        } else {
            // Fallback on earlier versions
        }
    }
}

.navigationViewStyle(.columns) doesn't work
 
 
Q