React Native集成react-native-qrcode-svg(二维码生成)
2019-03-27 14:43
543 查看
1、安装
#安装icon生成组件 npm install react-native-svg --save react-native link react-native-svg #安装二维码生成组件 npm install react-native-qrcode-svg --save
2、示例及效果
- 代码示例
/** * Copyright (C), 2017-2019 * FileName: App.js * Author: hf * Date: 2019/3/27 14:38 * Description: 测试二维码生成 * * History: * <author:> <time:> <version:> <desc:> */ import React, {Component} from 'react'; import {View} from 'react-native'; import QRCode from 'react-native-qrcode-svg'; export default class App extends Component<Props> { constructor(props) { super(props); } render() { let logoImg = require('./src/logo.jpg'); return ( <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}> <QRCode value="这是一个测试二维码..." logo={logoImg} logoBorderRadius={1} color={'#191919'} backgroundColor={'#ffffff'} logoSize={30} size={150} /> </View> ); }; };
- 效果图
- logo.jpg文件
相关文章推荐
- React Native 集成jpush-react-native
- React-Native 生成二维码
- React Native 集成jpush-react-native的示例代码
- React Native:Android集成React Native的一些配置
- qrcode.react和jquery.qrcode生成二维码
- thinkphp3.2集成QRcode生成二维码
- React Js 生成二维码 插件 qrcode.react
- iOS开发-QRCode-二维码识别与生成
- java qrcode 生成二维码
- Java生成二维码,基于QRCode
- Python使用QRCode模块生成二维码
- jquery-qrcode js生成二维码,完美解决 json
- React Native学习-调取摄像头第三方组件:react-native-image-picker
- phpqrcode 生成二维码
- 使用jquery-qrcode在页面上生成二维码,支持中文
- React Native 环境搭建 配置 调试 React Native for Android APP
- [React Native] Writing Platform-Specific Components for iOS and Android in React Native
- Python使用QRCode模块生成二维码
- ReactNative——集成RN到原生应用
- react native 生成APK