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

How to reset IOScrollView to the starting position? #1

Closed
sinkz opened this issue Dec 9, 2020 · 1 comment
Closed

How to reset IOScrollView to the starting position? #1

sinkz opened this issue Dec 9, 2020 · 1 comment

Comments

@sinkz
Copy link

sinkz commented Dec 9, 2020

I trying get ref of IOScrollView for reset this to initial position, but it did not work.

How i can reset this scrollView to initial position?

@zhbhun
Copy link
Owner

zhbhun commented Dec 10, 2020

just like ScrollView#scrollto

function Demo () {
  const scroller = useRef();
  useEffect(() => {
    scroller.current.scrollTo({ x: 0, y: 1000 }); // @see https://reactnative.dev/docs/scrollview#scrollto
  }, []);
  return (
    <IOScrollView ref={scroller}>
    </IOScrollView>
  );
}

@zhbhun zhbhun closed this as completed Dec 14, 2020
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