Android不支持使用react-native-image-crop-picker选择多个图像,如何解决?
enter code here
`handlePickImage = async()=> { 尝试{
console.log('hit')
const images = await ImagePicker.openPicker({
width: 1000,
height: 1000,
cropping: true,
multiple: true,
compressImageQuality: 0.5,
})
console.log(images)
for (const image of images) {
const path = image.path.split('/');
const fileName = path[path.length - 1]
console.log('fileNameforVideo', fileName)
this.setState(
{
files: [... this.state.files, { url: '', type: image.mime.split('/')[0], path: image.path }],
file: image.path,
fileName,
filetype: image.mime.split('/')[0],
mimeType: image.mime
})
await this.getSingedUrl();
}
} catch (error) {
console.log(error)
console.log('lol')
}
`在此先感谢
我不确定我是否能正确理解您遇到的问题,但是您使用的库在其文档中有一条注释:
“” Android:已知道具“裁剪”会导致视频无法在Android的图库中显示。选择视频时,请勿将裁剪设置为true。“
(链接到库自述文件here)
您似乎正确设置了multiple
选项,但我注意到您已将裁剪设置为true
,这可能是造成问题的原因。希望对您有所帮助!