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

Piotr Prus

03/01/2021, 10:28 PM
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

Albert Chang

03/02/2021, 12:06 AM
Wrap your composable with a
Box
and add padding to that.
t

Tash

03/02/2021, 3:01 AM
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

Piotr Prus

03/02/2021, 6:40 AM
Thanks. I was thinking about it, but thought it is an antipattern. I was looking was some item decorator 😀
a

Albert Chang

03/02/2021, 6:45 AM
If you are worrying about performance, you should read this.
🙏🏼 1
p

Piotr Prus

03/02/2021, 8:26 AM
Thanks. Great thread 🙂
2 Views