简体   繁体   English

ionic 3应用程序在浏览器上显示图像,但不在Android设备上显示

[英]ionic 3 app show image on browser but dont on android device

Thanks for any help, and sorry about my bad English, we speak Portuguese on my country... 感谢您的帮助,对于我的英语不好,我们深感抱歉。

ionic 3 app show remote image provided by api on browser with ionic serve but dont on android device, debug on chrome get this error: 7fa1ea1d73789d207ef51e6941913d5e_image.jpg:1 GET http://localhost:1337/parse/files/myAppId/7fa1ea1d73789d207ef51e6941913d5e_image.jpg net::ERR_CONNECTION_REFUSED ionic 3应用程序显示由api在具有ionic服务的浏览器上提供的api远程图像,但不在android设备上进行调试,而是在chrome上调试此错误:7fa1ea1d73789d207ef51e6941913d5e_image.jpg:1 GET http:// localhost:1337 / parse / files / myAppId / 7fa1ea1d73789d207ef51e69419jpg。网:: ERR_CONNECTION_REFUSED

any help... 任何帮助...

I think you might have use relative paths for images like <img src="../assets/imgs/logo.png"> Don't use relative paths for images instead use absolute paths like <img src="assets/imgs/logo.png"> 我认为您可能对图像使用了相对路径,例如<img src="../assets/imgs/logo.png">不要对图像使用相对路径,而要使用诸如<img src="assets/imgs/logo.png">

Please refer below link for more details: 请参考以下链接以获取更多详细信息:
https://forum.ionicframework.com/t/images-not-displayed-on-device/89145 https://forum.ionicframework.com/t/images-not-displayed-on-device/89145

If you want yo use localhost images when running on the device with ionic run android ——device —lc you should use your api address instead. 如果要在使用ionic run android device-lc的设备上运行时使用本地主机映像,则应改用您的api地址。 You can see it with the command ipconfig in your terminal 您可以在终端中使用命令ipconfig看到它

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

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