I am using page 3, when displaying data, I found that if the page switches and returns to the bottom page, the data will automatically roll to the top.
If there are two items, it will automatically scroll to the top, if there is one item, there is no problem
val pagingItems = viewModel.windList.collectAsLazyPagingItems()
LazyColumn(Modifier.fillMaxSize()) {
item {
...
}
items(pagingItems) { wind ->
if (wind != null) {
WindRow(navController, wind)
}
}
}
This way is fine
LazyColumn(Modifier.fillMaxSize()) {
items(pagingItems) { wind ->
if (wind != null) {
WindRow(navController, wind)
}
}
}
I inevitably use multiple items. How can I solve it?