How can I make Box() (or anything else) scrollable...
# compose
j
How can I make Box() (or anything else) scrollable in both directions? Using
Copy code
.verticalScroll(rememberScrollState())
.horizontalScroll(rememberScrollState())
makes it scrollable just one direction at a time.
👀 2
k
Do nested boxes work?
z
transformable might help
d
Looks like it could be an upcoming built in feature, "Support 2d Drag/Scroll Gesture" is on the roadmap https://developer.android.com/jetpack/androidx/compose-roadmap
I copied the logic of vertical/horizontal scrolling and modified it to do both at the same time, was a few compose versions ago but the logic should still be similar https://gist.github.com/drampelt/eba8384a5a89b6974bc2c998559c9577