HomeiOS Developmentios - Is there a risk to vary navigation bar title by...

ios – Is there a risk to vary navigation bar title by altering view in Navigation Stack? SwiftUI


I am attempting to vary navigation bar title by tapping one in every of tabs in tabview. Is there an opportunity to do it?

This is the code I am utilizing:

struct ContentView: View {
    var physique: some View {
        NavigationStack {
            TabView {
                Tab("", systemImage: "home") {
                    HomeView()
                }
                Tab("", systemImage: "notice.textual content") {
                    AvailableOrdersView()
                }
                Tab("", systemImage: "checkmark.sq.") {
                    BookedOrdersView()
                }
                Tab("", systemImage: "gear") {
                    SettingsView()
                }
            }
            .navigationTitle("TaxiApp")
            .navigationBarTitleDisplayMode(.inline)
            .toolbarBackground(.cyan, for: .navigationBar)
            .toolbarBackgroundVisibility(.seen, for: .bottomBar)
            .toolbarBackground(.cyan, for: .bottomBar)
        }
    }
}

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments