【发布时间】:2018-03-30 05:48:27
【问题描述】:
我正在使用 react native cameraroll api 将我的图像保存在存储中。
CameraRoll.saveToCameraRoll(data.uri)
.then(console.log('Success', 'Photo added to camera roll!'))
.catch(err => console.log('err:', err))
以上代码成功将图像保存在存储中,如 (DCIM/imageName.jpg)
但我想更改图像的位置以保存在其他地方,例如 (testfolder/1/imagename.jpg) 我试过这样:
CameraRoll.saveToCameraRoll({
uri: data.uri,
album: 'test',
}, 'photo').then((newUri) => {
console.log('new location of image => ', newUri);
})
我阅读了此链接https://facebook.github.io/react-native/docs/cameraroll.html#savetocameraroll,但没有适当的指南或参数集来更改位置。
谁能指导我如何更改保存图像的路径?
【问题讨论】:
-
有人有解决办法吗?
-
DIGITAL JEDI,有答案吗?如果是,请分享。
标签: javascript android reactjs react-native camera-roll