Hide android bottom navigation view for child screens/ fragments Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of Hide android bottom navigation view for child screens/ fragments without wasting too much if your time.

The question is published on by Tutorial Guruji team.

I’m trying to create a single activity Android application.
I have MainActivity (only activity) with BottomNavigationView, three top level fragments and some child fragments. My requirement is whenever the screen is showing top level fragments, bottom navigation should be visible such that switching is possible. But when I’m viewing any of the child fragments, bottom navigation should be hidden.
Is there any out-of-box way using the Navigation component or need to change the visibility manually ?

Answer

You have to make a method in MainActivity for visibility. Do call that method from fragments where you want to show or hide.

One thing I faced with such scenario is, bottom navigation visibility is not being properly gone. So I put bottom navigation view in Relative layout and hide that parent view.

We are here to answer your question about Hide android bottom navigation view for child screens/ fragments - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji