【问题标题】:How do I add a custom font to an Android Application? [duplicate]如何将自定义字体添加到 Android 应用程序? [复制]
【发布时间】:2015-07-23 10:13:48
【问题描述】:

如何将自定义字体添加到 <TextView /> 或 Android 应用程序的自定义视图中?

【问题讨论】:

    标签: java android textview custom-font


    【解决方案1】:

    试试这个,

      TextView tx = (TextView)findViewById(R.id.hello);
      Typeface custom_font = Typeface.createFromAsset(getAssets(),
      "fonts/Erika Type.ttf");
      tx.setTypeface(custom_font);
    

    【讨论】:

      猜你喜欢
      • 2013-07-30
      • 2011-07-10
      • 2011-04-19
      • 1970-01-01
      • 2020-02-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多