0

enter image description here

I have many views each one of them has "NavigationView" that I use to add different buttons, when it tries to navigate between them the "NavigationLink" push the destination navigation view down as shown in the image down, So did there is a way to navigate between views without "NavigationLink", or using the "NavigationLink" without effects the destination "NavigationView" appearance.

NavigationLink(destination: ListsView()) { }



 [![struct ListsView: View {

        // To detect the edit mode
        @State private var isEditMode = false
        
        var body: some View {
            
            NavigationView {
                
                Text("Hiiii")
                    
                    // View edit mode
                    .environment(\.editMode, .constant(self.isEditMode ? EditMode.active : EditMode.inactive))
                    // Navigation bar
                    .navigationBarTitle("Lists", displayMode: .automatic)
                    .toolbar(content: {
                        // More/Done
                        ToolbarItem(placement: .navigationBarTrailing) {
                            Group {
                                switch self.isEditMode {
                                case true:
                                    Button(action:{
                                        withAnimation {
                                            self.$isEditMode.wrappedValue = false
                                        }
                                    }, label: {
                                        Text("Done")
                                    })
                                case false:
                                    ListsMenuView(isEditMode: $isEditMode)
                                }
                                
                            }
                        }
                    })
            }
            .navigationViewStyle(DefaultNavigationViewStyle())
        }
    }][1]][1]
Ammar Ahmad
  • 534
  • 5
  • 24

0 Answers0