一个纯JavaScript写的可变换图像组件,如PhotoView或ImageViewer,支持手势,如平移,捏,双标签和fling,适用于iOS和Android。
https://github.com/ldn0x7dc/react-native-transformable-image
A pure JavaScript written transformable image component, like PhotoView or ImageViewer, supports gestures like pan, pinch, double tab and fling, works with both iOS and Android.
Written in pure JS, this component should be one of the most easy to use component among all the zoomable, scrollable PhotoView alike views on react-native.
npm install --save react-native-transformable-image@latest
Quite same as the official Image, as below shows:
import Image from 'react-native-transformable-image'; ... render() { return ( ... <Image style={{width: width, height: height}} source={{uri: 'https://raw.githubusercontent.com/yoaicom/resources/master/images/game_of_thrones_1.jpg'}} //pixels={{width: 3607, height: 2400}} /> ... ); }You can provide enableTransform, enableScale and enableTranslate props to control corresponding features.
inherited from react-native-view-transformer
If you are looking for an image gallery component, please refer to react-native-gallery, which is based on this component.