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

vide

08/15/2022, 3:56 PM
Is LazyGrid compatible at all with fixed width children? This seems to stretch the items even with the horizontal arrangement 🤔
Copy code
LazyVerticalGrid(
        columns = GridCells.Fixed(4),
        horizontalArrangement = Arrangement.SpaceBetween,
        verticalArrangement = Arrangement.spacedBy(Spacing.SPACE_12)
    ) { items(20) { idx -> Box(Modifier.size(50.dp).background(Color.Red)) }}
s

shikasd

08/15/2022, 8:10 PM
The spacing only applies between columns, the item content is stretched to full width You can wrap content with another transparent box and align your fixed size items inside it
o

orangy

08/15/2022, 9:38 PM
I think you can implement GridCells yourself and make it fixed width
v

vide

08/16/2022, 7:10 AM
This makes sense, thanks for the explanation!
2 Views