显示存储在手机上的图像 [英] Display an image stored on phone

查看:47
本文介绍了显示存储在手机上的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功地在我的应用程序中拍摄了一张照片并将其存储在手机上,但我如何显示它?

I have succesfully been able to take a photo inside my app and store it on the phone, but how do I display it?

我尝试了这种静态方法,但它不起作用(是的,图像在那里:))

I tried this static approach but it does not work (Yes the image is there :) )

 <Image width={40} height={40} source={{uri: '/storage/emulated/0/DCIM/IMG_20161201_125218.jpg'}} />

推荐答案

即使我遇到了这个问题并得到了解决.您必须在文件路径前面加上 file://(注意双/).

Even I faced this issues and got it resolved. You have to prepend the the file path with file:// (mind the double /).

<Image source={{uri:'file:///storage/emulated/0/DCIM/IMG_20161201_125218.jpg'}}
    style={myImageStyle}/>

这是一个参考

我希望这会有所帮助:)

I hope this helps :)

这篇关于显示存储在手机上的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆