Kotlin Compose 多个条目滚动

LazyRow or LazyCloumn 都可以横向滚动。非常不错的。。

但是。他们只有一列非常单调

可以使用

LazyVerticalGrid
@OptIn(ExperimentalFoundationApi::class)
@Preview
@Composable
fun SimpleList() {
    LazyVerticalGrid(
        cells = GridCells.Adaptive(minSize = 128.dp)
    ) {
        items(100) { photo ->
            Text(text = "First ${photo}item")
        }
    }
}

 非常不错

猜你喜欢

转载自blog.csdn.net/mp624183768/article/details/125610933