0

Navigation View inside Tabview No issue in portrait mode In landscape mode, navigation view and all subviews are "collapsed" into a top-level menu. See screen shots below.

Is it normal behaviour? Could not find any modifier to change this behaviour if it is normal.

Portrait mode

Landscape mode

Landscape mode after clicking top left menu

Test project showing issue:-

TabView {
    ChartView().tabItem {
        Label("Chart", systemImage: "chart.bar")
    }
    Page1View().tabItem {
        Label("Received", systemImage: "tray.and.arrow.down.fill")
    }
}

body of Page1View struct:-
var body: some View {
    NavigationView {
        VStack(spacing: 10) {
        // ... removed for clarity
        }
        .toolbar {
            ToolbarItem(placement: .navigationBarLeading) {
                Text("tbar1")
            }
            ToolbarItem(placement: .navigationBarTrailing) {
                Text("tbar2")
            }
            ToolbarItem(placement: .navigationBarTrailing) {
                Text("tbar3")
            }
        }
    }
}
sydney888
  • 1
  • 1
  • Does this answer your question? [Swiftui NavigationView + TabView doesn't show navbar item](https://stackoverflow.com/questions/70912438/swiftui-navigationview-tabview-doesnt-show-navbar-item) – burnsi Dec 04 '22 at 12:27

1 Answers1

0

Found solution to this issue is that same as listed in:- Swiftui NavigationView + TabView doesn't show navbar item

Added navigationViewStyle of .stack:-

NavigationView{ 
}
.navigationViewStyle(.stack)
sydney888
  • 1
  • 1