Su Su Aung
08/10/2023, 11:29 AMverticalArrangement = Arrangement.spacedBy(16.dp)
to LazyColumn.
But I want to remove that padding from the very 1st child inside that lazy list, is there a way?
P.S. I tried to use Modifier.layout { ...
but because my items don't have minHeight defined, it's throws exception when tried to get the constraints.maxHeigh.curioustechizen
08/10/2023, 11:47 AMcontentPadding
parameter to LazyList?Su Su Aung
08/10/2023, 11:58 AMcontentPadding
in my LazyColumn.
But contentPadding
is to add a padding before the first item or after the last one.
I want to add a spacing between each item, so I used verticalArrangement
.curioustechizen
08/10/2023, 12:06 PMSu Su Aung
08/10/2023, 12:43 PMcurioustechizen
08/10/2023, 12:47 PMcontentPadding
and verticalArrangement
, then your "Current" is what your list will look like at rest. Then, when you start scrolling, it will look like your "Desired".
Do you want your list to look like your "Desired" even before you start scrolling? In that case I think you should set your contentPadding
to have top - 0.dp
Su Su Aung
08/10/2023, 1:02 PMcontentPadding
to have top - 0.dp
-> We cannot set negative values to paddings in compose.Su Su Aung
08/10/2023, 1:03 PMModifier.layout { ...
to set the negative paddings with offset, but sadly cannot as my items don't have minimum height.Stylianos Gakis
08/10/2023, 1:04 PMArrangement.spacedBy(16.dp)
for them items themselves there should just not be any space at the top anyway, what are you referring to when you mention negative padding?curioustechizen
08/10/2023, 1:15 PMtop = 0.dp
, not top - 0.dp.Su Su Aung
08/10/2023, 1:30 PM0.dp
works.
Thanks guys! 🙌