使用 React Native 相机拍摄多张图像
Take multiple images with react native camera
我正在尝试使用 ReactNativeCamera 模块拍摄多张图像。我首先有两个功能用于拍摄图像:
takePicture() {
const options = {};
this.setState({searching:false});
this.camera.capture({metadata: options})
.then((data) => {
console.log(data);
this.setState({filePath:data.path})
})
.catch(err => console.error(err));
}
发生这种情况时,屏幕会冻结并显示我拍摄的图像。我现在无法拍摄另一张照片。我试过这样:
retakeImage(){
this.setState({searching:true});
this.camera.startPreview();
}
知道我做错了什么,或者如何重新启动图像预览吗?
所以我在这里找到了解决方案:https://github.com/react-native-community/react-native-camera/issues/1115
0.13版本的React Native Camera模块好像有bug
我正在尝试使用 ReactNativeCamera 模块拍摄多张图像。我首先有两个功能用于拍摄图像:
takePicture() {
const options = {};
this.setState({searching:false});
this.camera.capture({metadata: options})
.then((data) => {
console.log(data);
this.setState({filePath:data.path})
})
.catch(err => console.error(err));
}
发生这种情况时,屏幕会冻结并显示我拍摄的图像。我现在无法拍摄另一张照片。我试过这样:
retakeImage(){
this.setState({searching:true});
this.camera.startPreview();
}
知道我做错了什么,或者如何重新启动图像预览吗?
所以我在这里找到了解决方案:https://github.com/react-native-community/react-native-camera/issues/1115
0.13版本的React Native Camera模块好像有bug