I'm using the BottomNavigation
from Accompanist and I want to have it drawn behind the navigation bar. I get the navigation bar insets from WindowInsets.navigationBars.getBottom
but this value is way too high and creates a large gap (see image). How can I get the correct content padding for the navigation bar?
This is the code
@Composable
fun NavigationBar(
navController: NavHostController,
modifier: Modifier = Modifier,
) {
val density = LocalDensity.current
val bottomPadding = WindowInsets.navigationBars.getBottom(density).dp
BottomNavigation(
modifier = modifier,
contentPadding = PaddingValues(bottom = bottomPadding),
) {
// content omitted for brevity
}
}