react-native - 如何修复 react-native-barcode-builder 条形码空白
问题描述
我的 react-native 条码只显示黑色全黑条。
我已经做好了npm install react-native-svg --save && react-native link react-native-svg
下面是我的代码
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
import Barcode from 'react-native-barcode-builder';
export default class Example extends Component {
render() {
return (
<View>
<Text>
React Native Barcode Builder
</Text>
<Barcode value="Hello World" />
</View>
);
}
}
我希望我能得到普通的条形码而不是全黑
解决方案
将背景颜色设置为白色,如下所示:
<Barcode value="Hello World" background="#ffffff" format="CODE128" />
推荐阅读
- python - Python - 找到匹配项后如何读取字符串的其余部分
- bash - 在订购和终止时收集产品的自定义字段数据
- python - 如何获得 2d DataFrame 中一系列值的平均值
- firebase - 网站所有者的错误:无效的网站密钥 ~ Google reCAPTCHA ~ GitLab CI
- amazon-web-services - 将公共 SSL 用于动态域以映射到单个云端
- angularjs - 范围 $watch 导致无限摘要循环
- vuejs2 - 测试中缺少 Vue 路由器视图
- django - 复杂的查询数据库
- c# - 最大和的路径
- reactjs - React-Native-Voice,如何将新的语音结果与之前的语音识别结果连接起来?