Question: What's the best way to keep a vertically scrollable Text object, whose content is always added to, always scrolled to the bottom by default? Thanks!
π 2
t
theapache64
02/24/2022, 4:08 AM
You mean something like a Chat window ?
k
Kebbin
02/24/2022, 4:09 AM
Yes, mate thanks.
Kebbin
02/24/2022, 4:09 AM
Specifically a Serial Monitor window, which I have sorta working now!
t
theapache64
02/24/2022, 4:18 AM
You can use a
LaunchedEffect
like this, right?
Copy code
val list = remember { mutableStateListOf<String>("A") }
val listState = rememberLazyListState()
LaunchedEffect(list.size) {
listState.animateScrollToItem(list.lastIndex)
}