Monday 28 October 2019

react native zoom view


original

zoom in to see license plate

pan

zoom out and pan

zoom out

furthest

npm install @dudigital/react-native-zoomable-view

import React from 'react';
import { View, Image, Text, StyleSheet } from 'react-native';
import ReactNativeZoomableView from '@dudigital/react-native-zoomable-view/src/ReactNativeZoomableView';

export default class App extends React.Component {

  render() {
    return (
      <View style={{ flex: 1 }}>
        <ReactNativeZoomableView
          maxZoom={1.5}
          minZoom={0.5}
          zoomStep={0.5}
          initialZoom={1}
          bindToBorders={true}

          style={{

          }}
        >
          <View style={{ flex: 1, justifyContent: "center" }}>
            <View style={{ alignItems: 'center' }}><Text style={{ fontSize: 30 }}>Content</Text></View>
            <Image style={{ width: null, height: '90%' }}
              source={require('./img/2R.jpg')}
              resizeMode="stretch" />
            <View style={{ alignItems: 'center' }}><Text style={{ fontSize: 30 }}>Content</Text></View>
          </View>
        </ReactNativeZoomableView>
      </View>
    );
  }
}

reference:
https://github.com/DuDigital/react-native-zoomable-view
https://wall.alphacoders.com/big.php?i=953683

3 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Hi!
    If you are looking for the best React Native App Development Company, to build exceptional app for your business.

    ReplyDelete
  3. This is important for developers to know how to execute this code because a lots of companies want to hire skilled Mobile App Developers.

    ReplyDelete