logo
  • 教程列表
  • SO官方文档
  • 获取系统字体名称并使用字体
    • 获取系统字体名称
    • 将系统字体应用于 TextView
  1. StackOverflow 文档
  2. Android 教程
  3. 获取系统字体名称并使用字体
  4. 将系统字体应用于 TextView

将系统字体应用于 TextView

Created: November-22, 2018

在以下代码中,你需要将 fontsname 替换为你要使用的字体名称:

TextView lblexample = (TextView) findViewById(R.id.lblexample);
lblexample.setTypeface(Typeface.createFromFile("/system/fonts/" + "fontsname" + ".ttf"));
  • 获取系统字体名称

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明