https://kotlinlang.org logo
#compose
Title
# compose
s

Se7eN

09/17/2020, 10:27 AM
I'm using
Scaffold
with
BottomNavigation
and it looks like the bottom navigation bar is covering
bodyContent
Copy code
Scaffold(
    topBar = {
        TopAppBar(
            title = { ... },
            navigationIcon = { ... },
            actions = { ... },
            backgroundColor = MaterialTheme.colors.surface,
            elevation = 0.dp
        )
    },
    bodyContent = { ChatScreen(viewModel) },
    bottomBar = {
        BottomNavigation(
            backgroundColor = MaterialTheme.colors.surface,
            elevation = if (isSystemInDarkTheme()) 0.dp else 4.dp
        ) {
            BottomNavigationItem(
                icon = { ... },
                selected = true,
                onClick = {},
                label = { ... },
            )

            BottomNavigationItem(
                icon = { ... },
                selected = false,
                onClick = {},
                label = { ... }
            )
        }
    }
)
Is this a bug or am I doing something wrong?
I have a
LazyColumnFor
and it's scrolled to the bottom in the image
t

Timo Drick

09/17/2020, 10:32 AM
You need to forward the innerPadding of the bodyContent to your child views:
Copy code
bodyContent = { innerPadding -> ChatScreen(innerpadding, viewModel) },
Copy code
Modifier.padding(innerPadding)
👍 1
s

Se7eN

09/17/2020, 10:36 AM
Got it. Thanks!
And lol sorry for the language
4 Views