I want to do navigation with Scaffold and BottomNavigation in Jetpack Compose. They are in the MainPage. But when I click the content in the MainPage and navigate to DetailPage, the BottomNavigation also exist, like the image:
How can I hide the BottomNavigation in the DetailPage?


You need to specify which screens you want to show and which screens you dont want; Otherwise it will show to all the screens inside
Scaffold's body (which you havebottomBar). The code below was from my app.Create a state which observes any destination changes on the navController
Inside
whenyou can put any screens that you want to shownavigationBarelse just setcurrentScreentoNoBottomBarOn the Scaffold where you put ur bottomBar
so you can check if
currentScreenwasNoBottomBarif it was, don't show it