Android - How to create a responsive scrollable Column inside another Column without fixed height?


I’m trying to build a layout in Jetpack Compose where I have a Column nested inside another Column, and I want the inner one to be scrollable.

The key requirement is that the scrollable container should be responsive — I don’t want to set a fixed height (e.g. height(250.dp)), because it should adapt to different screen sizes and layouts.

My current approach with verticalScroll() works, but only when I constrain the height, which I want to avoid.

Column( modifier = Modifier .height(250.dp) .verticalScroll(rememberScrollState())
0
Apr 2 at 6:20 AM
User AvatarStanisław Olszak
#android#mobile#android-jetpack-compose

Accepted Answer

weight(1f) expands the container fully, which you don’t want.
Use heightIn(max = ...) to cap the height while keeping it flexible.
This allows verticalScroll() to work without fixed or forced sizing.

User AvatarRashmi R
Apr 2 at 5:55 PM
1