Rekha
05/25/2023, 5:35 AMfun MyScreen() {
val items = listOf("Item 1", "Item 2", "Item 3")
LazyVerticalGrid(
columns = GridCells.Fixed(2),
modifier = Modifier.padding(16.dp)
) {
item {
ItemCard(items[0])
}
item {
ItemCard(items[1])
}
item {
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.Center
) {
ItemCard(items[2])
}
}
}
}
Dan MacNeil
05/25/2023, 1:37 PMcolumns = GridCells.Fixed(2),
. Look at https://developer.android.com/jetpack/compose/lists#lazy-grids.Rekha
05/26/2023, 4:24 AMDan MacNeil
05/26/2023, 2:10 PMitem
takes a span
parameter. This should do what you want.
item(span = {
// LazyGridItemSpanScope:
// maxLineSpan
GridItemSpan(maxLineSpan)
})