When I have a vertically scrollable `Column` and a...
# compose
u
When I have a vertically scrollable
Column
and a section at the bottom of it that expands/collapses with
AnimatedVisibility
, when I collapse it everything "shrinks" as expected / visually scroll position changes, but when expanding, it expands off screen, i.e. it seems to keep the scroll position but measured from the top - can I have it behave exactly the opposite of collapsing?
a
Assuming you're using
verticalScroll
, there's a
reverseScrolling
parameter which can help for the behavior here. Assuming that you want to always start at the top still, there's a trick where you can initialize the
scrollState
to be at a
Int.MAX_VALUE
position with `rememberScrollState(initial = Int.MAX_VALUE)`: https://github.com/alexvanyo/composelife/blob/f21c7fb55ee097e4ecdf91ea8ee874551d9f[…]tlin/com/alexvanyo/composelife/ui/app/action/InlineSpeedPane.kt
👍 1
u
will try thank you