https://github.com/react-native-studio/react-native-android-barcodescanner
android扫码插件,解决android上zxing扫码慢的问题,该插件使用的是zbar
https://github.com/react-native-studio/react-native-android-barcodescanner
Last synced: 10 months ago
JSON representation
android扫码插件,解决android上zxing扫码慢的问题,该插件使用的是zbar
- Host: GitHub
- URL: https://github.com/react-native-studio/react-native-android-barcodescanner
- Owner: react-native-studio
- Created: 2018-03-02T02:50:22.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-02T06:17:16.000Z (almost 8 years ago)
- Last Synced: 2025-03-30T18:02:12.149Z (11 months ago)
- Language: Java
- Homepage:
- Size: 76.2 KB
- Stars: 7
- Watchers: 0
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## react-native-android-barcodescanner [](https://badge.fury.io/js/react-native-android-barcodescanner)
## 第一步
工程目录下运行 npm install --save react-native-android-barcodescanner 或者 yarn add react-native-android-barcodescanner(已经安装了yarn)
### 注意:
version 0.1.1适用于大于等于rn0.44和小于0.47
version 0.1.5适用于rn0.47及以上
加入``````权限
## 第二步
运行 react-native link react-native-android-barcodescanner
## 第三部使用
在工程中导入:
```bash
import ZbarScannerView from 'react-native-android-barcodescanner';
{ToastAndroid.show(JSON.stringify(data),ToastAndroid.SHORT)}}
hintText={''}
renderTopBarView={() => }
renderBottomMenuView={() => }
/>
```
## Props

|Prop|Type|Default|Optional|
|:--:|:--:|:--:|:--:|
|maskColor|string|#0000004D|true|
|borderColor|string|#000000|true|
|cornerColor|string|#000000|true|
|borderWidth|number|0|true|
|cornerBorderWidth|number|4|true|
|cornerBorderLength|number|20|true|
|rectHeight|number|200|true|
|rectWidth|number|200|true|
|isCornerOffset|bool|false|true|
|cornerOffsetSize|number|0|true|
|bottomMenuHeight|number|0|true|
|scanBarAnimateTime|number|2500|true|
|scanBarColor|string|#22ff00|true|
|scanBarImage|any|null|true|
|scanBarHeight|number|1.5|true|
|scanBarMargin|number|6|true|
|hintText|string|将二维码/条码放入框内,即可自动扫描|true|
|hintTextStyle|object|{ color: '#fff', fontSize: 14,backgroundColor:'transparent'}|true|
|hintTextPosition|number|130|true|
|isShowScanBar|bool|true|true|
|bottomMenuStyle|object|-|true|
|renderTopBarView|func|-|flase|
|renderBottomMenuView|func|-|false|
|onScanResultReceived|func|-|false|