4
4
.
.
2
2
.
.
7
7
S
S
c
c
r
r
o
o
l
l
l
l
a
a
b
b
l
l
e
e
C
C
o
o
l
l
u
u
m
m
n
n
I
I
n
n
f
f
o
o
[
[
R
R
]
]
ScrollableColumn is Container View which organizes his child Views vertically like Column (on top of each other).
But unlike Column you can scroll items vertically if they don't all fit on the screen.
Syntax
import androidx.compose.foundation.ScrollableColumn
import androidx.compose.foundation.layout.Column
ScrollableColumn {
Column {
for (i in 0..100) {
Text("$i Hello World!")
}
}
}
E
E
x
x
a
a
m
m
p
p
l
l
e
e
In this example we create ScrollableColumn View with too many Text Views to fit on the screen.
MainActivity.kt
package com.example.testcompose
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.foundation.ScrollableColumn
import androidx.compose.foundation.Text
import androidx.compose.foundation.layout.Column
import androidx.compose.ui.platform.setContent
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
ScrollableColumn {
Column {
for (i in 0..100) {
Text("$i Hello World!")
}
}
}
}
}
}
Output