Skip to content

Instantly share code, notes, and snippets.

@akulsr0
Created September 5, 2020 13:47
Show Gist options
  • Save akulsr0/a95ea2c142c4c8619b4239c1be32b417 to your computer and use it in GitHub Desktop.
Save akulsr0/a95ea2c142c4c8619b4239c1be32b417 to your computer and use it in GitHub Desktop.
React Native UI App - Zoomable View
import React from 'react';
import {
View,
Image,
} from 'react-native';
// npm install @dudigital/react-native-zoomable-view
import ReactNativeZoomableView from '@dudigital/react-native-zoomable-view/src/ReactNativeZoomableView';
export default function App() {
return (
<View style={{ width: '100%' }}>
<ReactNativeZoomableView
maxZoom={5.0}
minZoom={0.5}
zoomStep={1}
initialZoom={1}
bindToBorders={true}
style={{
width: '100%',
padding: 50,
}}
>
<Image
style={{ width: '100%', height: 400 }}
source={{
uri:
'https://images.pexels.com/photos/1855349/pexels-photo-1855349.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500',
}}
/>
</ReactNativeZoomableView>
</View>
)
}
@marmar666
Copy link

Yeudu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment