您的位置:首页 > 移动开发

React Native WebView组件实现的BarCode(条形码)、(QRCode)二维码

2017-06-21 17:12 447 查看


react-native-barCode

采用React Native WebView组件实现的BarCode(条形码)、QRCode(二维码),其中QRCode的代码是参考 qrcode,修复了qrcode图片会出现滚动条问题。https://github.com/chenchunyong/react-native-barCode

实现的原理:在
WebView
组件下,用
canvas
组件画出BarCode、QRCode。


Install

安装包:

npm i react-native-barcode --save


通过引用
import {BarCode,QRCode} from 'react-native-barcode-qrcode'
来使用


Usage

import {BarCode,QRCode} from 'react-native-barcode-qrcode'
<BarCode    value={this.props.payCode}
width="225"
height="90"
bgColor="#e7e7eb"
/>
<QRCode value={this.props.payCode}
bgColor="#fff"
fgColor="#333"/>


效果如下:



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: