0

我有可组合的空片段:

setContent {
    Surface(
        modifier = Modifier
            .fillMaxWidth().fillMaxHeight().padding(bottom = 48.dp, top = 16.dp),
        color = colorResource(id = R.color.usaa_white)
    ) {
        val itemsList = (0..50).toList()
        val itemsIndexedList = listOf("A", "B", "C")
        LazyColumn(
        ) {
            items(itemsList.size) {
                Text("Item is $it")
            }
            item {
                Text("Single item")
            }
            itemsIndexed(itemsIndexedList) { index, item ->
                Text("Item at index $index is $item")
            }
        }
    }
}

问题是:我只能滚动内容直到“单项”行,其余内容被隐藏。我添加了一些填充以确保它没有覆盖列表的底部导航栏,但它仍然被裁剪。

4

1 回答 1

0

看起来问题是由底部导航栏引起的。有趣的是,它仅LazyColumn在我使用时发生并且工作正常。Column 我发现的修复是将 contentPadding 添加到底部。(但希望找到更好的解决方案)

LazyColumn(contentPadding = PaddingValues(bottom = 70.dp)) { }
于 2022-02-08T18:55:12.660 回答