How to change the font on the TextView?

前端 未结 16 1074
清歌不尽
清歌不尽 2020-11-22 08:09

How to change the font in a TextView, as default it\'s shown up as Arial? How to change it to Helvetica?

16条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-22 08:20

    Typeface tf = Typeface.createFromAsset(getAssets(),
            "fonts/DroidSansFallback.ttf");
    TextView tv = (TextView) findViewById(R.id.CustomFontText);
    tv.setTypeface(tf);
    

提交回复
热议问题