aaron
aaron

Reputation: 31

Android ScrollView onScrollBeginDrag and onScrollEndDrag not working

when I set onScrollBeginDrag and onScrollEndDrag, it's doesn't work. Does this property not support in Android?

<ScrollView
 horizontal={true}
 showsHorizontalScrollIndicator={false}
 pagingEnabled={false}
 scrollEventThrottle={16}
 iosalwaysBounceHorizontal={false}
 onScrollBeginDrag={this._onScrollBeginDrag}
 onScrollEndDrag={this._onScrollEndDrag}
 onScroll={this._onScroll}
 ref='_scroll'>

_onScrollBeginDrag=()=>{// do something};
_onScrollEndDrag=()=>{// do something};

Upvotes: 2

Views: 1325

Answers (2)

Mohamed Nehad
Mohamed Nehad

Reputation: 1

use the ScrollView provided by react-native-gesture-handler

i had the same problem and it worked for me.

Upvotes: 0

TeChn4K
TeChn4K

Reputation: 2405

Unfortunaly, I was not able to use horizontal mode and onScrollBeginDrag / onScrollEndDrag events.

Remove horizontal and it will works...

I have not found any true workaround for now. But you can use onMomentumScrollBegin / onMomentumScrollEnd.

Upvotes: 1

Related Questions