I have to use Scaffold top and bottom bar across t...
# compose
k
I have to use Scaffold top and bottom bar across the screens. SignIn and Splash screen do not need top and bottom bar. How do I use navController with Scaffold? Do I hoist Scaffold above NavHost and hide top and bottom bar on certain screens? Is it possible to have NavHost inside NavHost to manage screens that use Scaffold?
j
I have sort of a similar setup. I just put the NavHost inside the Scaffold, the BottomBar is put inside of the Scaffold and watches the navigation hierarchy to see which tab should be selected (as described here: https://developer.android.com/jetpack/compose/navigation). The topbar however, I put into the view itself for views that need it. The more correct setup would be to use the TopBar in the scaffold that hosts the NavHost and hoist the state I think, but for me the setup described above works fine as well, even though that means I sometimes have a nested Scaffold (Scaffold > NavHost > Scaffold).