diff --git a/README.md b/README.md index ae43768..a991646 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ A react-native component to generate [QRcode](http://en.wikipedia.org/wiki/QR_co ## Installation ```sh -npm install react-native-qrcode --save +npm install react-native-webview react-native-qrcode --save ``` ## Usage ```jsx diff --git a/lib/Canvas.js b/lib/Canvas.js index 3b1ab26..cfb5754 100644 --- a/lib/Canvas.js +++ b/lib/Canvas.js @@ -6,10 +6,21 @@ var createReactClass = require('create-react-class'); var { View, - WebView, Platform } = require('react-native'); +var {WebView} = require('react-native-webview'); + +// Fixed QRCode not filling the whole screen +var AutoSetScale = ` + setTimeout(() => { + const meta = document.createElement('meta'); + meta.setAttribute('content', 'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0'); + meta.setAttribute('name', 'viewport'); + document.getElementsByTagName('head')[0].appendChild(meta); + }, 100) +` + var Canvas = createReactClass({ propTypes: { style: PropTypes.object, @@ -25,6 +36,7 @@ var Canvas = createReactClass({ return (