kevin
05/27/2021, 1:56 PMjim
05/27/2021, 3:47 PMBox(
Modifier.scrollable(
orientation = Orientation.Vertical,
state = scrollable
)
) {
Text("...")
}
}
kevin
05/27/2021, 4:22 PMval scrollState = rememberScrollState(0)
Box(
modifier = Modifier.scrollable(orientation = Orientation.Vertical, state = scrollState)
) {
Text(
"... long text here ...",
color = Color.White,
fontFamily = FontFamily.Monospace,
fontSize = fontSize
)
}
But I still do not have scrolling enabled
I changed it to
val scrollState = rememberScrollState()
Box(
modifier = Modifier.verticalScroll(scrollState)
) {
Text(
fileData.toString(),
color = Color.White,
fontFamily = FontFamily.Monospace,
fontSize = fontSize
)
VerticalScrollbar(
rememberScrollbarAdapter(scrollState),
modifier = Modifier.align(Alignment.CenterEnd).fillMaxHeight()
)
}
and I have scrolling but no scroll bar
Do I need to add a VerticalScrollbar
to the composition (and if so, how?)jim
05/27/2021, 4:55 PMIgor Demin
05/27/2021, 4:59 PMVerticalScrollbar
should be outside of `verticalScroll`:
Box(
modifier = Modifier.fillMaxSize()
) {
Text(
text = (1..10000).joinToString { "x" },
modifier = Modifier.verticalScroll(scrollState)
)
VerticalScrollbar(
rememberScrollbarAdapter(scrollState),
modifier = Modifier.align(Alignment.CenterEnd).fillMaxHeight()
)
}
Igor Demin
05/27/2021, 5:14 PMkevin
05/27/2021, 8:26 PM