i know `FlowRow` is still experimental, is there s...
# compose
j
i know
FlowRow
is still experimental, is there support for it to have vertical scrolling?
i'm currently trying
Copy code
FlowRow(Modifier.verticalScroll(scrollState)) {
            repeat(500) {
                val color = when (it % 4) {
                    0 -> Color.Green
                    1 -> Color.Black
                    2 -> Color.Cyan
                    else -> Color.White
                }
                Box(Modifier.width(100.dp).height(100.dp).background(color))
            }
        }
but it doesn't seem to scroll despite those boxes going way off screen
I have also tried with a
nestedScroll
but I also can't seem to get that working properly
s
Does it not work to contain the FlowRow inside a Column which itself is scrollable? Unless I am misunderstanding what you’re going for of course
a
You can wrap it in a composable with scroll if it doesn’t work directly.
Modifier on FlowRow also seems to work fine for me.
Copy code
@OptIn(ExperimentalLayoutApi::class)
@Composable
fun FlowRowDemo() {
    FlowRow(
        Modifier.verticalScroll(rememberScrollState()),
    ) {
        repeat(500) {
            Text(
                text = animalNames[it % animalNames.size],
                modifier = Modifier.padding(
                    16.dp,
                ),
            )
        }
    }
}
animalNames
is a list of strings.
j
Ah, I guess its actually my inner composable thats stealing the scroll. my box sample ended up working but when i switch to my real one it fails