I am trying to add space between 2 columns (elemen...
# compose
p
I am trying to add space between 2 columns (elements) in my
LazyVerticalGrid
. So far, no luck. contentpadding is used for padding around whole lazyGrid, not individual item. In
LazyColumn
, there is a parameter called verticalArrangement which can be used to add spacer between elements, but how can I do that for Grid?
a
Wrap your composable with a
Box
and add padding to that.
t
Similar to above, item Composables can have individual padding. You’d have to adjust the overall LazyVerticalGrid’s contentPadding accrodingly to make the inner/outer padding match. The API might later be updated to support that, though.
p
Thanks. I was thinking about it, but thought it is an antipattern. I was looking was some item decorator 😀
a
If you are worrying about performance, you should read this.
🙏🏼 1
p
Thanks. Great thread 🙂