【问题标题】:How to apply custom font for the whole app? [duplicate]如何为整个应用应用自定义字体? [复制]
【发布时间】:2012-11-26 13:52:21
【问题描述】:

可能重复:
Android: Want to set custom fonts for whole application not runtime

我知道有以下方法可以做到这一点。但我想将字体应用于整个应用程序。那可能吗?

TextView txt = (TextView) findViewById(R.id.customfont);
Typeface font = Typeface.createFromAsset(getAssets(), "fonts/Molot.otf");
txt.setTypeface(font);

【问题讨论】:

    标签: android custom-controls


    【解决方案1】:

    但是,如果您查看接受的回复,则不可能为整个申请提供一个:

    Android: Want to set custom fonts for whole application not runtime

    他们有一个解决方案,可以更轻松地将其设置为任何视图:) 另一种方法是创建一个自定义小部件来替换 TextView,但如果您也需要其他小部件上的字体,它会变得非常混乱!

    【讨论】:

      猜你喜欢
      • 2011-11-28
      • 2012-08-30
      • 2015-03-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-05
      • 2016-02-28
      • 1970-01-01
      相关资源
      最近更新 更多