Material 3 NavigationBar change colorElevation on navigationBar

326 Views Asked by At

I have a NavigationBar in Scaffold, but its color elevation is 1.dp or 2.dp, but not 3.dp.

            Scaffold(
                content = { padding ->
                    Box(modifier = Modifier.padding(bottom = padding.calculateBottomPadding())) {
                        CurrentTab()
                    }
                },
                bottomBar = {

                    NavigationBar(
                        containerColor = MaterialTheme.colorScheme.surface,
                        contentColor = MaterialTheme.colorScheme.secondaryContainer,
                        tonalElevation = 1.dp,
                    ) {
                        navigationTabs.forEach {
                            TabNavigationItem(it)
                        }
                    }
                },
            )

Defaut elevation is 3.dp, and elevation of android system navigationBar color is 3.dp by default too.

Screen

Now i try to change elevation of color, but navigationBar still have 3.dp elevation by default. I want to set android system navigationBar 1.dp elevation too.

I can change color of system navBar on top composable ofc, but this bar is transparent and other screens uses this.

What is the best way to solve this?

0

There are 0 best solutions below