0.1.8 • Published 6 years ago

react-native-android-barcodescanner v0.1.8

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

react-native-android-barcodescanner npm version

第一步

工程目录下运行 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及以上 加入<uses-permission android:name="android.permission.CAMERA" />权限

第二步

运行 react-native link react-native-android-barcodescanner

第三部使用

在工程中导入:

import ZbarScannerView from 'react-native-android-barcodescanner';
<ZbarScannerView
            style={{flex:1}}
            onScanResultReceived={(data)=>{ToastAndroid.show(JSON.stringify(data),ToastAndroid.SHORT)}}
            hintText={''}
            renderTopBarView={() => <View></View>}
            renderBottomMenuView={() => <View></View>}
        />
<br/>

Props

npm.io

PropTypeDefaultOptional
maskColorstring#0000004Dtrue
borderColorstring#000000true
cornerColorstring#000000true
borderWidthnumber0true
cornerBorderWidthnumber4true
cornerBorderLengthnumber20true
rectHeightnumber200true
rectWidthnumber200true
isCornerOffsetboolfalsetrue
cornerOffsetSizenumber0true
bottomMenuHeightnumber0true
scanBarAnimateTimenumber2500true
scanBarColorstring#22ff00true
scanBarImageanynulltrue
scanBarHeightnumber1.5true
scanBarMarginnumber6true
hintTextstring将二维码/条码放入框内,即可自动扫描true
hintTextStyleobject{ color: '#fff', fontSize: 14,backgroundColor:'transparent'}true
hintTextPositionnumber130true
isShowScanBarbooltruetrue
bottomMenuStyleobject-true
renderTopBarViewfunc-flase
renderBottomMenuViewfunc-false
onScanResultReceivedfunc-false
0.1.8

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago