我正在这样做,但它变得很接近。我想更改 textview 字体
。
TextView mWeddingDataandTime=(TextView)findViewById(R.id.wedding_weddingtime_txt);
Typeface face=Typeface.createFromAsset(getAssets(),"fonts/CURLZ_.otf");
mWeddingDataandTime.setTypeface(face);
我正在使用 .otf
文件。它位于 Assets 文件夹中。有什么想法吗?
最佳答案
试试这个:
TextView txt = (TextView) findViewById(R.id.custom_font);
Typeface font = Typeface.createFromAsset(getAssets(), "Chantelli_Antiqua.ttf");
txt.setTypeface(font);
请注意,文件扩展名是“ttf” 在谷歌中搜索此扩展名中的任何字体以供下载
关于android - 如何在android中将字体设置为textview?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9684345/