一些离子没有显示 [英] some ionicons not showing

查看:44
本文介绍了一些离子没有显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到我在我的cordova 项目中使用的一些图标没有显示在我的任何设备上.那些不起作用的图标名称中似乎有 ios 或 android 一词(例如:ion-android-list 或 ion-ios-book-outline).任何想法为什么他们只是出现空白?到目前为止,我使用的任何带有通用名称的图标都可以正常工作(例如 ion-clock、ion-card).我从这里获取的图标名称:ionicons

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 android in the icon name (eg: ion-android-list or ion-ios-book-outline). Any ideas why they are just showing up blank? So far any icon I have used with a generic name works fine (eg ion-clock, ion-card). The icon names I am fetching from here: ionicons

我已将其包含在我的 index.html 文件中:

I have included this in my index.html file:

<link href="lib/ionic/css/ionic.css" rel="stylesheet">

推荐答案

使用 ionic start 从 CMD 加载过时的图标库 v1.5.2 (latest是 v2.0.0).

Apparently the latest version of ionic when building an ionic app using ionic start from CMD loads an outdated icon library v1.5.2 (latest is v2.0.0).

  • 要更新字体,请访问最新的 ionicons 站点并下载.
  • 解压并导航到/fonts 目录,然后将这 4 个文件复制到您的应用的 www/lib/ionic/fonts 目录(覆盖).
  • 对 scss 文件夹执行相同操作并粘贴到 www/lib/ionic/scss/ionicons(覆盖).
  • 最后从解压的 zip 文件/css/ionicicons.css 中打开 ionicons.css 文件并将该文件的内容复制到 www/lib/ionic/css/ionicons.css(注意:确保您编辑并只替换现有字体版本大约占前 1500 - 2000 行,您将看到注释指示)

这篇关于一些离子没有显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆