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")
}
}
}
非常不错