-2

I am making a app and there are too many back buttons in my navigation view

Arabic is at the bottom

They are all in the same navigation view

Please help

NavigationView {
    List {
        NavigationLink("Arabic"){
            Arabic()
        }
        NavigationLink("English"){
            English()
        }
        NavigationLink("Coptic"){
            Coptic()
        }
        NavigationLink ("Hazzat / Lyrics"){
            Hazzat()
        }
    }
}

NavigationView {
    List {
        NavigationLink("Liturgy"){
            ArLiturgy()
        }
        NavigationLink("Offering of Incense"){
            English()
        }
        NavigationLink("Tasbeha"){
            English()
        }
    }
}

enter image description here

koen
  • 5,383
  • 7
  • 50
  • 89
  • Do your `Arabic()`, `English()`, etc. views have their own `NavigationView`s? If so, don't do that. – vacawama Dec 11 '22 at 21:58
  • No they are all in one NavigationView but separate NavigationLinks but thanks – Programmer Pro Dec 11 '22 at 22:04
  • 1
    Your code does not demonstrate the problem. You need to add a minimal example that shows the problem. At a minimum, you need to include code for `Arabic()`, `English()`, etc. – vacawama Dec 11 '22 at 22:12
  • 1
    Most apps only need `NavigationView`, `TabView` and sheets are exceptions to this rule but it is evident that you have too many of them. – lorem ipsum Dec 11 '22 at 22:39

1 Answers1

2

You only need one NavigationView in your app. Delete the NavigationView from your child views and only provide the list of NavigationLinks. Those NavigationLinks will be pushed onto the stack created by the original NavigationView.

vacawama
  • 150,663
  • 30
  • 266
  • 294