Created
September 5, 2020 13:47
-
-
Save akulsr0/a95ea2c142c4c8619b4239c1be32b417 to your computer and use it in GitHub Desktop.
React Native UI App - Zoomable View
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeudu