google-material-icons - 材料图标问题:Apache Royale 上没有图片图标
问题描述
我想使用 TourDeJewel 中的图标图像,但是当我使用此代码时,会显示文本“菜单”而不是图标图片。(SDK 0.9.6)
<j:IconButton >
<j:icon>
<js:FontIcon text="menu" material="true"/>
</j:icon>
</j:IconButton>
使用浏览器检查器工具检查后,material-icons
缺少 css
有人能告诉我为什么吗?先感谢您...
解决方案
要自动链接CSS,您需要MaterialIconType
至少使用一次 class,以便编译器可以处理它。
原因是类inject_html
在其构造函数中有一个指令,因此当编译器发现它时会自动包含它。
在Tour De Jewel中,我们通过绑定使用该类:
<j:IconButton click="drawer.isOpen ? drawer.close() : drawer.open()">
<j:icon>
<js:FontIcon text="{MaterialIconType.MENU}" material="true"/>
</j:icon>
</j:IconButton>
(请注意,在该文件中,我们在顶层使用绑定珠来进行绑定(即:)<js:ContainerDataBinding/>
。
如果您不想使用MaterialIconType
,可以使用自定义 html 模板手动链接。
推荐阅读
- c++ - 未显示匹配运算符
- android - 如何将电话身份验证与电子邮件身份验证 firebase android 联系起来
- reactjs - 反应中的点击功能
- python - 在 spyder 4 上安装 spyder_autopep8 并让它工作
- python - 可迭代的问题(Sum 和 for 循环)
- gitlab - 如何在 Gitlab 中默认允许在所有组中创建项目?
- reactjs - 尝试使用 React 调用 Wikipedia api,但返回一个无用的对象
- python - 如何从 txt 文件打印用户特定的文本
- vba - 如何根据另一个文本框的计数替换最后一个字符
- javascript - How can I use multiple random YouTube v3 API keys