我正在使用Cordova的fileTransfer(真实设备:Android 5.0,Cordova 5.2内置Meteor)
onSuccess: function(entry)
console.log(entry.toInternalURL);
}
entry.toInternalURL,输出:
cdvfile://localhost/files/my_file.png
但是,当我尝试通过以下方式在html(流星模板)中加载图像时:
<img src='cdvfile://localhost/files/my_file.png' />
我也尝试过meteor.local和/ persistent变体,但是没有运气。
@dragonmnl,
要在网络视图中加载图片,可以使用相对路径,而不是绝对路径。这适用于所有Cordova实现。如果您的映像存储在其他位置(不在www
目录下),则一种解决方案是将其转换为base64并使用data:URI
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句