Answers for "jetpack compose viewpager"

0

jetpack compose viewpager

// Display 10 items
HorizontalPager(count = 10) { page ->
    // Our page content
    Text(
        text = "Page: $page",
        modifier = Modifier.fillMaxWidth()
    )
}
Posted by: Guest on October-03-2021
0

jetpack compose viewpager

val pagerState = rememberPagerState()

HorizontalPager(count = 10, state = pagerState) { page ->
    // ...page content
}

// Later, scroll to page 2
scope.launch {
    pagerState.scrollToPage(2)
}
Posted by: Guest on October-03-2021

Code answers related to "jetpack compose viewpager"

Browse Popular Code Answers by Language