Home > AI > IOS > SwiftUI >

navigationBackButton remove text

FirstDetailView.swift


struct FirstDetailView: View {
    @Environment(\.presentationMode) var mode: Binding<PresentationMode>
    
    var body: some View {
        Text("FirstDetailView")
            .navigationBarTitle("First Detail", displayMode: .large)
            .navigationBarBackButtonHidden(true)
            .navigationBarItems(leading: Button(action: {mode.wrappedValue.dismiss()}, label: {
                Image(systemName: "chevron.left")
            }))
    }
}

FirstTabView.swift

struct FirstTabView: View {

    var body: some View {
        NavigationView {
            ScrollView {
                NavigationLink(
                    destination: FirstDetailView(),
                    label: {
                        Text("First detail")
                    })
                
            }.navigationBarTitle("First", displayMode: .inline)
        }
        
    }
}
Relevant tags:

Leave a Reply