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

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

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

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:ionic

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;this

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

这是纠结了一下午的问题,记录下来,但愿也对你们有所帮助!orm

相关文章
相关标签/搜索