I have nine screens and I want use NavHost with HorizontalPagerIndicator.
1 Answer
Use HorizontalPager
val pagerState = rememberPagerState(pageCount = { 10 }) HorizontalPager(state = pagerState) { page -> // Our page content Text( text = "Page: $page", modifier = Modifier.fillMaxWidth() ) } for more details refer Pager in compose
2 Comments
Slava
NavHost with views must be inside HorizontalPager? Or I can't use NavHost with pager?
Atul Sharma
@Slava
NavHost is used for multiple screen mappings and Pager are also used for same purpose so I clearly don't understand you POV for using NavHost inside Pager. As there are already multiple tabs to represent different screen in Pager.