some ionicons not showing

后端 未结 5 629
心在旅途
心在旅途 2021-01-06 11:31

I have noticed that some of the icons I am using in my cordova project are not displaying on any of my devices. The ones that aren\'t working seem to have the word ios or an

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-06 11:45

    Looks like you're using Ionic, rather than just Cordova.

    You could do a partial upgrade to the forthcoming release of Ionic, which includes Ionicons v2:

    1. Download /config/lib/fonts and /scss/ionicons from the latest nightly into the corresponding places in your /www/lib folder

    2. Make sure you have gulp installed locally: npm install gulp

    3. Run ionic setup sass (NOTE: backup your ionic.project file first as this makes some changes)

    4. Replace the files in /www/lib/ionic/css with the new ones in /www/css (requires some renaming).

    5. Fix the relative paths in these copied files: replace ../lib/ionic/fonts with ../fonts

    I'm sure there's an easier way, but this worked for me. Someone's made a feature suggestion for always keeping ionicons up to date.


    Update:

    Animated icons aren't supported with Ionicons v2 yet (ion-spinner will be the replacement). Here's a hack to get them back:

    https://github.com/driftyco/ionicons/issues/111#issuecomment-65788526

    You need to add display:inline-block to the animation class to work on Android.

提交回复
热议问题