[react-native] onPanResponderRelease on FlatList or ListView not firing in android

I have a FlatList component and I want to implement the PanResponder API, below is a 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

won't start on components FlatList

or ListView

or VirtualizedList

, OS is android, is it an RN error? how to fix this problem, any help is appreciated.

+3
android react-native


source to share


No one has answered this question yet

Check out similar questions:

1116
Android SDK installation not finding JDK
586
What is the difference between React Native and React?
568
What is the difference between using a constructor and getInitialState in React / React Native?
415
React Native android build failed. SDK location not found
402
How do I update my Android watchlist?
360
Hide keyboard in responsive mode
191
Android failed to load JS package
3
Change root of Flatlist renderItem
1
android dev: item in listview cannot set focus correctly
0
React Native to implement JSON data in ListView



All Articles
Loading...
X
Show
Funny
Dev
Pics