Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PageView does not work in ScrollView #647

Closed
canozt opened this issue Aug 2, 2022 · 2 comments
Closed

PageView does not work in ScrollView #647

canozt opened this issue Aug 2, 2022 · 2 comments

Comments

@canozt
Copy link

canozt commented Aug 2, 2022

I am using version 3.1.0. In swiftui, Pageview does not work when you put it in ScrollView. Probably it is related to nested scrollviews issue. It works when you set frame but the content of the pageview will be dynamic. Is there any trick to solve that issue ?

ScrollView {
      PageView(options: getOptions(), items: items, selectedIndex: $selectedIndex) { item in
           VStack {
                   ForEach(0..<100) { i in
                        Text("\(i)")
                   }
               }
            }
}
@lasodashutosh
Copy link

@canozt were you able to find the solution to this?

@canozt
Copy link
Author

canozt commented Nov 22, 2022

@lasodashutosh Not really. Firstly i tried to calculate the height of the inner scroll and set the frame height with that value. It works but then i did not like that solution. Then i remove the upper ScrollView, and put it into PageView.

@canozt canozt closed this as completed Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants