Here's my code to generate a paging scrollview in React-native:
<ScrollView
horizontal
pagingEnabled
onScrollEndDrag={this.handlePagerScroll}
scrollsToTop={false}
scrollEventThrottle={100}
removeClippedSubviews={false}
automaticallyAdjustContentInsets={false}
directionalLockEnabled
showsHorizontalScrollIndicator={false}
showsVerticalScrollIndicator={false}
>
{ renderPageHere() }
</ScrollView>
The code above is working.
Function this.handlePagerScroll
which attached to onScrollEndDrag
event is working too. The problem is that I can't determine which page that's currently active, since onScrollEndDrag
has no event paremeter
I think to use simple math using value in x
or y
to no avail since I have no idea how to obtain them
Does anyone familiar with my problem and can offer me any solution? Thank you