Get current scroll position of ScrollView in React Native

后端 未结 11 1509
遇见更好的自我
遇见更好的自我 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条回答
  •  萌比男神i
    2020-11-27 11:25

    Use

     this.getscrollposition(event)} 
     scrollEventThrottle={16}>
    

    Show Position

    getscrollposition(e) {console.log('scroll y ', e.nativeEvent.contentOffset.y);}
    

提交回复
热议问题