在React Native中旋转多点触控手势

问题描述

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

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

enter image description here

解决方法

检查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>