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

来源:互联网 发布:淘宝字体侵权 编辑:程序博客网 时间:2024/05/20 11:24

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"/>

效果如下:

阅读全文
0 0
原创粉丝点击