如何从离子应用程序访问和显示图像? [英] How do I access and display images from an ionic app?
问题描述
我在与运行后显示图像的问题。
I'm having issues with displaying images after running
ionic run ios
我有默认的模板ionicframework与sidemenu运行,并没有任何改变应用程序的目录结构。
I have the default ionicframework template running with the sidemenu, and have not changed the app directory structure at all.
我有一个内联CSS从类别的NG-重复指令指定的背景图像。
I have an inline css to specify a background image from an ng-repeat directive for categories.
style='background: url("{{category.img}}")
我试过../img/picture.jpg,/img/picture.jpg和IMG / picture.jpg。无似乎工作。请帮助!
I've tried ../img/picture.jpg, /img/picture.jpg and img/picture.jpg. None seem to work. Please help!
在此先感谢
推荐答案
我有同样的问题,我的项目结构是这样的:
I had the same issue, my project structure look like this:
/www/
/images/
/views/page.html
index.html
和 page.html即可
IMG链接是:< IMG SRC =图像/ image.png../>
和它的工作为网络和移动版本。
and in page.html
img links was: <img src="images/image.png" ../>
and it worked for both web and mobile build.
希望这有助于。
这篇关于如何从离子应用程序访问和显示图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!