https://kotlinlang.org logo
#compose
Title
# compose
d

Daniel Candeias

06/09/2021, 4:22 PM
How can i center my items inside a
LazyVerticalGrid
?
Copy code
LazyVerticalGrid(
    cells = GridCells.Fixed(4)
) {
    itemsIndexed(data) { row, dataItem ->
          CustomComposedView(dataItem)
    }
}
Expected behavior for 6 elements: x x x x x x
r

Ravi

06/09/2021, 8:14 PM
what will be the expected behavior for 7 elements?
a

Albert Chang

06/09/2021, 10:51 PM
You can't do this with
LazyVerticalGrid
. Consider using
LazyColumn
.
👍 1
r

Ravi

06/09/2021, 11:16 PM
@Daniel Candeias you can tweak this logic as per your use case
5 Views