【问题标题】:Rotating Multitouch Gesture in React Native在 React Native 中旋转多点触控手势
【发布时间】:2020-11-10 11:01:31
【问题描述】:

在使用 React Native 时,多点触控手势是否有任何限制/缺点?

例如,我想通过按住并沿相反方向拖动两个手指来旋转屏幕上的项目:

【问题讨论】:

    标签: react-native rotation gesture multi-touch


    【解决方案1】:

    看看这个react-native-easy-gestures

    import Gestures from 'react-native-easy-gestures';
    
    /**
     * Another example:
     * Drag only on x axis;
     * Scale from 0.1 to 7;
     * Do not rotate;
     * On release callback;
     */
    <Gestures
      draggable={{
        y: false,
      }}
      scalable={{
        min: 0.1,
        max: 7,
      }}
      rotatable={false}
      onEnd={(event, styles) => {
        console.log(styles);
      }}
    >
      <Image
        source={photo}
        style={{
          width,
          height,
        }}
      />
    </Gestures>
    

    【讨论】:

      猜你喜欢
      • 2020-08-17
      • 1970-01-01
      • 2015-02-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-12
      • 2011-08-22
      相关资源
      最近更新 更多