Get current scroll position of ScrollView in React Native

后端 未结 11 1522
遇见更好的自我
遇见更好的自我 2020-11-27 11:10

Is it possible to get the current scroll position, or the current page of a component in React Native?

So something like:

<         


        
11条回答
  •  被撕碎了的回忆
    2020-11-27 11:32

    As for the page, I'm working on a higher order component that uses basically the above methods to do exactly this. It actually takes just a bit of time when you get down to the subtleties like initial layout and content changes. I won't claim to have done it 'correctly', but in some sense I'd consider the correct answer to use component that does this carefully and consistently.

    See: react-native-paged-scroll-view. Would love feedback, even if it's that I've done it all wrong!

提交回复
热议问题