A pinch-to-zoom view for React Native. All the components wrapped in the view is scalable while still be able to respond to touch events.
npm install react-native-pinch-zoom-view --save
require
the react-native-pinch-zoom-view
module and then use the <PinchZoomView>
tag to wrap your content instead of <View>
.
'use strict';
import React, { Component } from 'react';
import {
AppRegistry,
TextInput
} from 'react-native';
import PinchZoomView from 'react-native-pinch-zoom-view';
class APP extends Component {
render() {
return (
<PinchZoomView>
<TextInput style={{width: 100}}></TextInput>
</PinchZoomView>
);
}
}
AppRegistry.registerComponent('APP', () => APP);
Values: true
or false
Default: true
In some cases, you may want to disable the pinch-zoom behaviour, just set scalable={false}
on the component.
Type: Number
Default: 0.5
Minimum scaling.
Type: Number
Default: 2
Maximum scaling.
Check out a simple example in Example.