這幾天費勁心思,終於把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