We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://blog.joanzapata.com/iconify-just-got-a-lot-better/
https://github.com/JoanZapata/android-iconify
优点:
缺点:
.ttf
关键是学习到了正确使用阿里iconfont+的姿势,下面简单说一下。
平时在做自己开发的APP时,没有专门的美工设计图标,所以都是从阿里iconfont+网站上搜索自己喜欢的图标,最后打包下载下来。
解压之后的文件列表如下,
/assets/
demo_unicode.html
unicode
iconify
需要注意的是,要对demo_unicode.html中的编码做一下转换
在Java代码中不能直接使用,需要转换成\uxe769即可,直接在Java代码中引用会报错。
Java

\uxe769
废话不多说,我们先看使用的例子。
<IconTextView android:text="Welcome {fa-smile-o} {fa-hand-peace-o} !" android:shadowColor="#22000000" android:shadowDx="0" android:shadowDy="5" android:shadowRadius="1" android:textSize="30sp" android:textColor="#2A9BDA" ... />
IconTextView将会用对应的图标替换{fa-smile-o} 和{fa-hand-peace-o}里面的内容。被替换上来的图标就跟text属性一样,有颜色、大小和阴影属性。无论图标多大,图标永远不会失真。
IconTextView
{fa-smile-o}
{fa-hand-peace-o}
text
你可以在TextView、Button甚至是ImageView和ToolBar菜单中使用图标。
TextView
Button
ImageView
ToolBar
The text was updated successfully, but these errors were encountered:
No branches or pull requests
https://blog.joanzapata.com/iconify-just-got-a-lot-better/
https://github.com/JoanZapata/android-iconify
为什么会使用iconify
优点:
缺点:
.ttf
文件。收集Icons
平时在做自己开发的APP时,没有专门的美工设计图标,所以都是从阿里iconfont+网站上搜索自己喜欢的图标,最后打包下载下来。
下载并解压
解压之后的文件列表如下,
使用
.ttf
文件存放到/assets/
目录下,方便在APP中使用。demo_unicode.html
,获取图标的unicode
。iconify
加载自定义图标。需要注意的是,要对
demo_unicode.html
中的编码做一下转换在
Java
代码中不能直接使用
,需要转换成\uxe769
即可,直接在Java
代码中引用会报错。最终使用例子
废话不多说,我们先看使用的例子。
IconTextView
将会用对应的图标替换{fa-smile-o}
和{fa-hand-peace-o}
里面的内容。被替换上来的图标就跟text
属性一样,有颜色、大小和阴影属性。无论图标多大,图标永远不会失真。你可以在
TextView
、Button
甚至是ImageView
和ToolBar
菜单中使用图标。The text was updated successfully, but these errors were encountered: