关于ionic 打包后 background-image 无法显示 的问题

这几天费劲心思,终于把ionic 项目打包生成 本地app,但是安卓手机安装以后,我所有的雪碧图的 icon ,竟然无法显示;到处搜索答案,都没有什么可行的,都是说什么ionic版本不对,android手机版本不兼容。 

最后,在stack overflow 上,尝试了 RILEY 这个位哥们的回答,确实完美的解决了这个问题:

Its not the size of the image that prevents it from displaying in ionic2.This is what you should do when the local image is not displaying:

remove the trailing ../ before your image folder or image name.The App already knows that all image are stored by default in the www folder.So you will have to use a format like this for all your images to display: Fir icons: and for background image;

意思是说本地app已经知道所有图片默认的存储路径是www 文件夹下,并不需要使用相对路径;所以解决方法是去掉 ../;

这是纠结了一下午的问题,记录下来,希望也对大家有所帮助!

 

转载于:https://www.cnblogs.com/luleixia/p/6586034.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值