Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 28468

onPanResponderRelease not working on android devices

$
0
0

When i am using panResponders on iOS devices it works properly but same code when i run on android devices it is not working as expected. Code is as below

componentWillMount() {
    this._panResponder = PanResponder.create({
        onStartShouldSetPanResponder: (evt, gestureState) => true,
        onStartShouldSetPanResponderCapture: (evt, gestureState) => true,
        onMoveShouldSetPanResponder: (evt, gestureState) => true,
        onMoveShouldSetPanResponderCapture: (evt, gestureState) => true,

        onPanResponderGrant: (evt, gestureState) => {
            return true;
        },
        onPanResponderTerminationRequest: (evt, gestureState) => {
            console.log('getting on android');
            return false;
        },
        onPanResponderRelease: (evt, gestureState) => {
            console.log('getting here')
            return true;
        },
        onPanResponderTerminate : (evt, gestureState) => {
            console.log('gets');
        }
    });
}

Also my scrollView snippet is as below.

<ScrollView
      ref={ref => this.myScroll = ref }
      {...this._panResponder.panHandlers}>

Viewing all articles
Browse latest Browse all 28468

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>