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

Bassam A.

01/07/2022, 10:34 AM
how can I make an activity scrollable in compose?
v

Vivek Sharma

01/07/2022, 10:34 AM
what do you mean by activity?
b

Bassam A.

01/07/2022, 10:35 AM
the screen itself.
I want the user to scroll down to click a button but when I run the application does not move.
Should I use
LazyColumn
?
v

Vivek Sharma

01/07/2022, 10:38 AM
use
LazyColumn
and inside it use
item{}
for single item and
items{}
for list
b

Bassam A.

01/07/2022, 10:39 AM
I just want to find another way to do it instead of LazyColumn as it’s not that long.
v

Vivek Sharma

01/07/2022, 10:40 AM
yeah u can use
Modifier.verticalScroll(scrollstate)
there is something like this, I don't correctly remember but IDE will give hint, try it out
v

Vivek Sharma

01/07/2022, 10:41 AM
and for the
scrollstate
, you can use like
val scrollstate = rememberScrollState
and pass i
b

Bassam A.

01/07/2022, 10:43 AM
Amazing. Thanks @Vivek Sharma & @Stylianos Gakis
2 Views