Skip to content

Instantly share code, notes, and snippets.

@saqib-github-commits
Last active April 11, 2023 09:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saqib-github-commits/7fe312d1cbaddcaa14e7e6af6334a57f to your computer and use it in GitHub Desktop.
Save saqib-github-commits/7fe312d1cbaddcaa14e7e6af6334a57f to your computer and use it in GitHub Desktop.
@OptIn(ExperimentalFoundationApi::class)
@Composable
fun HorizontalPagerSimpleExample() {
val pagerState = rememberPagerState()
HorizontalPager(pageCount = 5, state = pagerState) {
Box(modifier = Modifier
.fillMaxWidth()
.height(300.dp)
.background(Color.Gray),
contentAlignment = Alignment.Center
) {
Text(text = "Page Index : $it")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment