使用 LazyColumn 时 BottomBar 覆盖脚手架内容

rus*_*aof 2 android-jetpack-compose

当我在其内容中使用Scaffoldlong并在参数中使用一些可组合项时,我看不到该列的最后一项,因为它覆盖了它。有没有办法解决这个覆盖问题?LazyColumnbottomBarBottomBar

ngl*_*ber 11

在您的 中Scaffoldcontent有一个PaddingValues参数,您可以使用它来添加正确的填充。

像这样的东西:

Scaffold(
   ...
) {
    Box(
        modifier = Modifier
            .fillMaxSize()
            .padding(
                bottom = it.calculateBottomPadding()
            )
            //.padding(it) // <<-- or simply this 
    ) {
        // Your content
    }
}
Run Code Online (Sandbox Code Playgroud)