Roboto字体在我的Android应用程序 [英] Roboto font in my android app
本文介绍了Roboto字体在我的Android应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
谢谢,
Rahim。
解决方案
是的,为什么不,你可以得到Roboto字体:
让我们说您要更改文本视图的字体:
Typeface tf = Typeface.createFromAsset(getAssets(),
字体/的Roboto-Black.ttf);
TextView tv =(TextView)findViewById(R.id.FontTextView);
tv.setTypeface(tf);
Hi i am writing an android app. And I want the roboto font in it irrespective of the version of the phone. Is there a way to do it?
Thanks, Rahim.
解决方案
Yeah why not, you can get the Roboto font :
Lets say you want to change the font of a text view :
Typeface tf = Typeface.createFromAsset(getAssets(),
"fonts/Roboto-Black.ttf");
TextView tv = (TextView) findViewById(R.id.FontTextView);
tv.setTypeface(tf);
这篇关于Roboto字体在我的Android应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文