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

Can’t use scrollview, #14

Open
wisepmlin opened this issue Jun 21, 2021 · 1 comment
Open

Can’t use scrollview, #14

wisepmlin opened this issue Jun 21, 2021 · 1 comment

Comments

@wisepmlin
Copy link

The scrollview cannot be used in the view, and the offset will be set after use

@shanezzar
Copy link

shanezzar commented Jul 12, 2021

The scrollview cannot be used in the view, and the offset will be set after use

I was able to implement a solution,
https://gist.github.com/jfuellert/67e91df63394d7c9b713419ed8e2beb7

Use this as scroll view instead of the native one.

@State private var contentOffset: CGPoint = .zero

ScrollableView(self.$contentOffset, animationDuration: 0.5) {
  Group {
    // your stuff
  }
}
.frame(height: 300)

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