Hi,
From my ContentView I use a NavigationLink to go to an Order Overview WarehouseOrderOverview()
NavigationView{
ScrollView{
VStack{
NavigationLink(destination: WarehouseOrderOverview().environmentObject(self.settingStore).navigationBarTitle("Orders")) {
MenuButtonNavigation(title: "Order overview", color: Color.gray, icon: "doc.text.magnifyingglass").padding(.top)
}
WarehouseOrderOverview:
var body: some View {
List(warehouseOrderController.warehouseOrders){ warehouseOrder in
NavigationLink(destination: WarehouseOrderView(warehouseOrder: warehouseOrder).environmentObject(self.settingStore).navigationBarTitle("Details")){
OrderTableRow(warehouseOrder: warehouseOrder)
}
So far so good. If I now tap a row in that view, I get to the order details view WarehouseOrderView
NavigationView{
ScrollView() {
VStack{
VStack(spacing: -25) {
HStack(spacing: -25) {
NavigationLink(destination: WarehouseOrderLinesView(warehouseOrderLines: warehouseOrderLineController.warehouseOrderLines)){
TaskSummaryView(title: "Total Lines", color: .blue, icon: "list.dash", value: warehouseOrderLineController.warehouseOrderLines.count)
}
Problem is now that when I tap the TaskSummaryView, it opens the WarehouseOrderLinesView with two navigation bars on top (one going back to Orders, the other one to the Order details [too bad I cannot post a screenshot here ...])
I believe the issue is that I create a new NavigationView in my WarehouseOrderView but I get an error when trying to use the NavigationLink without embedding it in a NavigationView. Or is there a better way than NavigationLink to open the view WarehouseOrderLinesView?
Max
hi,
seems to work fine for me if you remove the NavigationView wrapper on the ScrollView in DetailView1 (at line 44).
it might help debugging this if you first add .navigationBarTitle("Main Level") to the ScrollView in the ContentView, and then also .navigationBarTitle("Level X", displayMode: .inline) in each of ListView1 ("X" = "1"), DetailView1 ("X" = "2"), and DetailView2 ("X" = "3"). then you'll see the problem.
hope that helps,
DMG