我收到这个removeImageForTag()
错误
这是我的源代码
ImageEditor.cropImage(
this.state.image,
imageData,
(successURI) => {
ImageStore.getBase64ForTag(successURI,
(base64Data) => {
console.log(base64Data);
},
(failure) => {console.log('failed to load')});
console.log(successURI);
ImageStore.removeImageForTag(successURI) <<<
},
(error) => { console.log('ERROR: ', error)}
)
我猜是包错误,但版本号似乎没问题。
react-native-cli: 2.0.1
react-native: 0.48.4
"expo": "^21.0.0",
removeImageForTag 文档在这里:https : //facebook.github.io/react-native/releases/0.39/docs/imagestore.html#removeimagefortag
我快疯了..怎么removeImageForTag
不能为Android定义?
然后我意识到在 Android 中,url(在您的示例中为成功 URI)是应用程序缓存的路径(例如:)file:///data/user/0/com.your.project/cache/ReactNative_cropped_image_-1677432906.jpg
。
您可以使用任何文件系统库删除图像(例如:rn-fetch-blob、react-native-fs或Expo.FileSystem.deleteAsync如果使用 expo)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句