Since version v0.19.0; offscreenLimit parameter has been removed. How to disable preloading using some other technique?
@Composable
fun MyComposable(){
val pagerState = rememberPagerState()
HorizontalPager(
state = pagerState,
modifier = Modifier.fillMaxSize(),
count = itemList.size,
) { i ->
MyPage(i)
}
}
What about something like this?
HorizontalPager(...) { i ->
if ((pagerState.currentPage - i).absoluteValue > 1) {
EmptyPage()
} else {
MyPage(i)
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With