0

I have nine screens and I want use NavHost with HorizontalPagerIndicator.

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

2 Comments

NavHost with views must be inside HorizontalPager? Or I can't use NavHost with pager?
@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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.