Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call event when scroll to bottom of ScrollView component in react native

Tags:

react-native

I have a question. How to call a function when scroll down bottom of ScrollView in react native? Please help me. Thank so much!

like image 211
jackmin Avatar asked Oct 07 '16 03:10

jackmin


1 Answers

It worked!

var windowHeight = Dimensions.get('window').height,
          height = e.nativeEvent.contentSize.height,
          offset = e.nativeEvent.contentOffset.y;
if( windowHeight + offset >= height ){
    console.log('End Scroll')
}
like image 142
jackmin Avatar answered Oct 11 '22 20:10

jackmin