第一次搞这个真是搞到自己要崩溃了
具体 *** 作Fontello字体库
https://fontello.com/
①选择自己需要的图标并点击download下载
<string name="left1"> back </string>//&#+图标代码,‘;’为引用字体与标准字体的分隔
其中,59392是图标代码,可以在刚才下载的文件config.Json中查看
<button androID:ID="@+ID/Title_back" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:layout_gravity="center" androID:layout_margin="5dp" androID:text="@string/left1" androID:textcolor="#fff"/>
⑥在onCreate下添加如下代码:
TextVIEw Titleback = (TextVIEw) findVIEwByID(R.ID.Title_back);Typeface Font = Typeface.createFromAsset(getAssets(), "Fontello.ttf");Titleback.setTypeface(Font);Titleback.setText(getResources().getString(R.string.left1));
⑦运行程序,就能看到我们导入的图标字体了
以上是内存溢出为你收集整理的在Android Studio中使用fontello图标字体全部内容,希望文章能够帮你解决在Android Studio中使用fontello图标字体所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)