cssivision / react-native-qrcode

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

Adapt to RN 0.48.0-rc.0. #34

Closed miyabi closed 7 years ago

miyabi commented 7 years ago

Change of WebView on RN 0.48.0-rc.0 causes that scales the QR code incorrectly on iOS.

https://github.com/facebook/react-native/commit/185948604c1bd58abe8db3632a78d768268b1cc4

Scaled incorrectly:

Fixed:

Example code:

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View
} from 'react-native';
import QRCode from 'react-native-qrcode'

export default class RNQRcodeExample extends Component {
  render() {
    return (
      <View style={styles.container}>
        <QRCode
          value={'test'}
          size={200}
          bgColor={'black'}
          fgColor={'white'}
        />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
});

AppRegistry.registerComponent('RNQRcodeExample', () => RNQRcodeExample);
cssivision commented 7 years ago

thanks for this pr.