2

I have 2 screens CourseList and second CourseDetail. where I'm able to hide navigationView on First/Initial Screen by blow code.

 var body: some View { NavigationView { List (networkManager.courses) { course in NavigationLink(destination: CourseDetails(course: course)) { CourseRow(course: course) } .padding(EdgeInsets(top: 0, leading: -8, bottom: 0, trailing: 0)) } .navigationBarTitle(Text("Courses"), displayMode: .inline) .navigationBarHidden(true) //It Hides NavigationView } } 

On Second Screen Course Detail I want to hide Navigationbar.

2 Answers 2

2

Add in your CourseDetails view:

.navigationBarTitle("") .navigationBarHidden(true) 

Sometimes you first need to set the title to be able to hide the navbar.

Sign up to request clarification or add additional context in comments.

Comments

1

You try with this code :

struct SecondScreen: View { var body: some View { VStack { BottomView() .offset(y: 90) } .navigationBarHidden(true) .navigationBarTitle("") }} 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.