Shr*_*h.K 3 android android-jetpack-compose jetpack-compose-accompanist
自版本 v0.19.0 起;offscreenLimit参数已被删除。如何使用其他技术禁用预加载?
@Composable
fun MyComposable(){
val pagerState = rememberPagerState()
HorizontalPager(
state = pagerState,
modifier = Modifier.fillMaxSize(),
count = itemList.size,
) { i ->
MyPage(i)
}
}
Run Code Online (Sandbox Code Playgroud)
像这样的事情怎么办?
HorizontalPager(...) { i ->
if ((pagerState.currentPage - i).absoluteValue > 1) {
EmptyPage()
} else {
MyPage(i)
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1122 次 |
| 最近记录: |