I have an Add Shopping List item Jetpack Compose screen which contains several TextField
inputs and an image container at the bottom. The screen overflows at the bottom and is cut off. How can I scroll the screen?
Asked
Active
Viewed 6,342 times
2

Raj Narayanan
- 2,443
- 4
- 24
- 43
2 Answers
5
Add Modifier.scrollable(..)
to the container that you wish to make scrollable.
Code would be something like this:
val scrollState = rememberScrollState()
...
Box( // or whatever your parent composable is
modifier = Modifier
.scrollable(state = scrollState, orientation = Orientation.Vertical)
) {
...
}
Of course, there are other Modifier
methods for making composables scrollable that might fit better for your case.

Primož Ivančič
- 1,984
- 1
- 17
- 29
-
this does not work for me with compose version 1.3.3 – Chirag Thummar Mar 11 '23 at 09:05
-
same here not working – Bipin Bharti May 07 '23 at 13:30
1
If the approved answer is not working try like below
val scrollState = rememberScrollState()
Column(
modifier = Modifier.verticalScroll(state = scrollState)
) {
...
}
Do not forget to apply it to your parent composable

Burak Karaduman
- 63
- 1
- 7