iconfont使用:
1、将.ttf文件放在assets文件中
2、将Typeface设置到textView上就可以展示
Typeface iconTypeface = Typeface.createFromAsset(getAssets(), "androidicons.ttf");
textView = (TextView)findViewById(R.id.iconView);
textView.setTypeface(iconTypeface);
本文介绍如何在Android应用中使用IconFont图标。主要步骤包括:将.ttf文件放置于assets文件夹下,然后通过Typeface设置将图标应用于TextView,实现自定义图标显示。
iconfont使用:
1、将.ttf文件放在assets文件中
2、将Typeface设置到textView上就可以展示
Typeface iconTypeface = Typeface.createFromAsset(getAssets(), "androidicons.ttf");
textView = (TextView)findViewById(R.id.iconView);
textView.setTypeface(iconTypeface);
975
821
1964

被折叠的 条评论
为什么被折叠?