I have a FlatList component, and I want realize PanResponder API on it, below is part of my code:
componentWillMount() {
this._panResponder = PanResponder.create({
onStartShouldSetPanResponder: ()=>true,
onMoveShouldSetPanResponder: ()=>true,
onPanResponderGrant: (e, gestureState)=>this.panResponderStart(e, gestureState),
onPanResponderMove: (e, gestureState)=>this.panResponderMove(e, gestureState),
onPanResponderRelease: (e, gestureState)=>this.panResponderEnd(e, gestureState),
onPanResponderTerminate: (e, gestureState)=>this.panResponderEnd(e, gestureState),
});
}
panResponderEnd(e, gestureState) {
//this._previousTop += gestureState.dy;
this.setState({scrollTop:0});
console.log('release');
}
...
<FlatList
{...this._panResponder.panHandlers}
...
onPanResponderRelease
doesn't trigger on FlatList
or ListView
or VirtualizedList
component, OS is android, is it a RN's bug? how to resolve this problem, any help is appreciated.