select multiple images from camera not working
**** working for single image capture and selection *****
imageCamera(){
this.setState({imageSourceText:'Camera'})
let imagearray ={}
ImagePicker.openCamera({compressImageMaxWidth:400,
compressImageMaxHeight:400,multiple: true
}).then(image => { .
在这里我只得到一个图像作为响应
this.setState({ImageSource:image})
console.log("cameraimagearray======="+this.state.ImageSource)
imagearray = {uri:image.path}
let tempArray = []
tempArray.push(imagearray)
console.log("tempArray from Camera ============="+tempArray);
this.setState({ImageSourceviewarray:tempArray})
console.log("image from Camera ============="+image.path);
}
);
}
阅读其他组件的文档,假设它做你想要的并且类似于你正在使用的!
https://github.com/ivpusic/react-native-image-crop-picker
我认为你不能使用openCamera
拍摄多张照片。它仅适用于单张照片。一种解决方案是手动打开相机,根据需要拍摄尽可能多的照片,当您关闭它时,请使用openPicker
并从中选择多张照片:
ImagePicker.openPicker({
multiple: true
}).then(images => {
console.log(images);
});