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

Afzal Najam

03/30/2022, 6:11 PM
Should the
scrollable
,
verticalScroll
, and
horizontalScroll
modifiers also have a
contentPadding
argument like the Lazy layouts do? Otherwise their children get clipped at the beginning and end if they’re animated to scale even a little bit.
j

Jan Bína

03/30/2022, 7:10 PM
There's no need for it, use normal padding modifier, just make sure to apply it after the scroll modifier:
Modifier.scrollable().padding()
In Lazy lists, you don't apply scrolling modifier yourself, so
padding
always sets the outer padding and
contentPadding
is needed to set the inner padding. This is not the case with
scrollable
and others, where you can do:
Copy code
Modifier
    .padding() //outer
    .scrollable()
    .padding() //inner
🙌 1
☝️ 1
jetpack compose 1
a

Afzal Najam

03/30/2022, 7:40 PM
And here I was creating my custom modifiers to avoid clipping, lol. Thank you!!
2 Views