New question :stuck_out_tongue: : Is there a way t...
# compose
n
New question 😛 : Is there a way to save the scroll position of a
LazyColumnItems
? I’m using a
TabRow
to display two tabs and each one display a list of content. When I swap between the tabs, the scroll position of the list is lost.
👍 3
t
It is not supported. As a temporary solution you could use this code snippet instead: https://gitlab.com/timod/compose-playground/-/blob/master/compose_list/src/main/java/de/drick/compose/list/LayoutList.kt
👍 1
n
Not so simple 😅 I hope Jetpack team tackle this soon.
t
You can use it the same way LazyColumnItems. E.g.:
Copy code
VerticalLayoutList(items = modelList) { item ->
n
That’s good… Why don’t you publish this as a lib?
t
I am currently working on this 😄 Its already prepared to create a local maven repo
👏 1
🚀 1
For now you can just copy the code from this single file. It is all you need.