如何在NativeScript应用程序中正确使用字体很棒的图标

发布于 2025-02-05 23:45:30 字数 485 浏览 0 评论 0原文

我在app.scss中定义了这个定义

.fas {
font-family: 'Font Awesome 5 Free', 'fa-solid-900';
font-weight: 900;
}

,并且正在尝试

<Button class="btn fas" text="&#xf095;"></Button>

在我的应用程序中使用这样的图标。它的呈现为

从我的阅读中,应该工作,但是我显然缺少某些配置项目。 有什么想法我可能会想念什么?

I have this defined in my app.scss

.fas {
font-family: 'Font Awesome 5 Free', 'fa-solid-900';
font-weight: 900;
}

and am trying to use an icon like this

<Button class="btn fas" text=""></Button>

in my app. which renders as

enter image description here

from my reading this should work, but I am obviously missing some config item.
Any ideas what I could be missing?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

╰◇生如夏花灿烂 2025-02-12 23:45:31

使用ICON字体时,使用代码的以下格式很幸运。

const icon = String.fromCharCode(0xf095);
<Button class="btn fas" [text]="icon"></Button>

I've had more luck using the following format of the code when using icon fonts.

const icon = String.fromCharCode(0xf095);
<Button class="btn fas" [text]="icon"></Button>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文