What would be the correct way to center your LazyV...
# compose
z
What would be the correct way to center your LazyVerticalGrid? As you can see on the right there's more spacing due to how adaptive cells work.
Copy code
LazyVerticalGrid(
  state = listState,
  contentPadding = PaddingValues(5.dp),
  cells = GridCells.Adaptive(24.dp)
) {
  items(items = items) { entry ->
    Text(text=entry.text)
  }
}
Looking at the source code I notice FixedLazyGrid uses
horizontalAlignment = Alignment.Start
. Could that be the reason I can't center it?
a
What if you try to wrap your text into
Copy code
Box(Modifier.fillMaxWidth(), contentAlignment = Alignment.Center)
👍 2
z
Thanks that worked! Looking at it the solution makes a lot of sense