I would like to have a scrollable element for horizontal scoll. I tried the following two code as example and both didn't work. Is there another way to get the scrollable element?
fun main() = Window {
val stateVertical = rememberScrollState(0F)
Row(modifier = Modifier.width(400.dp)
.horizontalScroll(stateVertical)) {
listOf(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17).forEach{
val text = "Hello, Desktop! $it"
Button(onClick = {
}) {
Text(text)
}
}
}
}
fun main() = Window {
ScrollableRow (modifier = Modifier.width(400.dp)){
listOf(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17).forEach{
val text = "Hello, Desktop! $it"
Button(onClick = {
}) {
Text(text)
}
}
}
}