我的 android 应用中的 Roboto 字体 [英] Roboto font in my android app
本文介绍了我的 android 应用中的 Roboto 字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在编写一个安卓应用程序.无论手机版本如何,我都希望在其中使用机器人字体.有办法吗?
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?
谢谢,拉希姆.
推荐答案
是的,为什么不,你可以得到 Roboto 字体:
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);
这篇关于我的 android 应用中的 Roboto 字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文