Component - LazyGrid
The LazyGrid is a UI component that displays a scrollable grid of items efficiently by only creating the visible items on screen. It helps show many items in rows and columns without slowing down the app.
The LazyGrid is a UI component that displays a scrollable grid of items efficiently by only creating the visible items on screen. It helps show many items in rows and columns without slowing down the app.
LazyVerticalGrid
├── columns = GridCells.Fixed(2)
└── Items (LazyGridScope)
├── Text (Item 1)
├── Text (Item 2)
├── Text (Item 3)
└── ...LazyVerticalGrid in Android Compose?LazyVerticalGrid(columns = GridCells.Fixed(2)) {
items(4) { index ->
Text(text = "Item $index")
}
}LazyVerticalGrid(columns = GridCells.Fixed(3)) {
items(5) { index ->
Text(text = "Item $index")
}
item {
Text(text = "Footer")
}
}Pass the test and this pattern moves unknown