我在网上找到了一些例子:
https://snack.expo.io/Sy8ulr8B-
主要概念是在每个组件中应用此代码:
this._panResponder = PanResponder.create({
onStartShouldSetPanResponder: () => {
this.resetTimer()
return true
},
onMoveShouldSetPanResponder: () => true,
onStartShouldSetPanResponderCapture: () => { this.resetTimer() ; return false},
onMoveShouldSetPanResponderCapture: () => false,
onPanResponderTerminationRequest: () => true,
onShouldBlockNativeResponder: () => false,
});
1条答案
按热度按时间n9vozmp41#
我找到了答案: