【发布时间】:2019-09-18 23:53:08
【问题描述】:
我正在使用react-native-qrcode-scanner,我想做的是:当用户按下手电筒图标 flashLight 继续
我这样做了:
<QRCodeScanner
showMarker
onRead={this.onSuccess.bind(this)}
cameraStyle={{ height: SCREEN_HEIGHT }}
cameraProps={{ flashMode: this.state.flashLight ? RNCamera.Constants.FlashMode.on : RNCamera.Constants.FlashMode.off, captureAudio: false }}
相机道具作品 但是当我改变 state.flashLight(真或假)时,闪光灯不会改变
任何想法如何改变相机道具的状态??
【问题讨论】:
-
您是否尝试在点击图标后使用
this.scanner.reactivate()?
标签: android react-native flashlight