简体   繁体   English

通过网络访问带有uri的本机图像组件

[英]React native Image component with uri accessed via network

Im trying to load an image from a website hosted on my PC that is shared via network so anyone in the same network can see. 我试图从通过网络共享的PC上托管的网站加载图像,以便同一网络中的任何人都可以看到。 i can access website on mobile browser and able to fetch in react native. 我可以在移动浏览器上访问网站,并能够以本机获取信息。 Image source found in google is working but the uri to access image from my website has problem. 在google中找到的图片源正在运行,但是从我的网站访问图片的uri存在问题。 My website is in laravel. 我的网站在laravel。

<Image source={{ uri: 'http://10.0.0.11:8083/img/test.jpg' }} style={{width: 341, height: 512, borderWidth: 2}} />

hard to compose a title, i don't know the short and right words. 很难撰写标题,我不知道简短和正确的词。

Are you using iOS to test this? 您是否正在使用iOS进行测试? If so the image isn't loading as Apple enforces https connections. 如果是这样,则由于Apple强制执行https连接而无法加载该图像。

See the answer here for more details. 有关更多详细信息,请参见此处的答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM