cssivision / react-native-qrcode

a minimalist qrcode component for react-native
MIT License
853 stars 304 forks source link

How to stop zoom-in and zoom-out animation on QR Code image #39

Closed GarimaMathur07 closed 7 years ago

sahir commented 7 years ago

@cssivision can you please help here

GarimaMathur07 commented 7 years ago

@cssivision is there any prop to stop zoom-in and zoom-out or touch event on QR Code.

icflorescu commented 7 years ago

Yes, you could wrap QRCode inside a TouchableOpacity:

    <TouchableOpacity>
      <QRCode
        value="encoded value"
        size={200}
        bgColor='purple'
        fgColor='white'
      />
    </TouchableOpacity>
GarimaMathur07 commented 7 years ago

@icflorescu Thanks for answer!!

I have fixed this issue with this following approach:

<View pointerEvents="none" style={qrCode.viewStyle}>
     <QRCode
        value="encoded value"
        size={200}
        bgColor='purple'
        fgColor='white'
       />
</View>

Note: 'none': The View is never the target of touch events.