Detect swipe left in React Native

后端 未结 4 1502
心在旅途
心在旅途 2020-12-18 19:50

How can I detect a left swipe on the entire screen in React Native?

Would it be necessary to use PanResponder or can it be done a little more easy?

4条回答
  •  旧巷少年郎
    2020-12-18 20:17

    If you are using a managed Expo project there is a documented gesture handler here: https://docs.expo.io/versions/latest/sdk/gesture-handler/

    The source code docs can be found here: https://docs.swmansion.com/react-native-gesture-handler/docs/

    For swiping I think you would need to use FlingGestureHandler: https://docs.swmansion.com/react-native-gesture-handler/docs/handler-fling

提交回复
热议问题