We recently released RNGH 2.0 with new Gestures system. Check out RNGH 2.0 section in Introduction for more information.
A continuous gesture handler that recognizes pinch gesture. It allows for tracking the distance between two fingers and use that information to scale or zoom your content. The handler activates when fingers are placed on the screen and change their position. Gesture callback can be used for continuous tracking of the pinch gesture. It provides information about velocity, anchor (focal) point of gesture and scale.
The distance between the fingers is reported as a scale factor. At the beginning of the gesture, the scale factor is 1.0. As the distance between the two fingers increases, the scale factor increases proportionally. Similarly, the scale factor decreases as the distance between the fingers decreases. Pinch gestures are used most commonly to change the size of objects or content onscreen. For example, map views use pinch gestures to change the zoom level of the map.
The handler is implemented using UIPinchGestureRecognizer on iOS and from scratch on Android.
Properties provided to
PinchGestureHandler do not extend common set of properties from base handler class.
See set of event attributes from base handler class. Below is a list of gesture event attributes specific to
The scale factor relative to the points of the two touches in screen coordinates.
Velocity of the pan gesture the current moment. The value is expressed in point units per second.
Position expressed in points along X axis of center anchor point of gesture
Position expressed in points along Y axis of center anchor point of gesture
See the scale and rotation example from Gesture Handler Example App.