Roboto字体在我的Andr​​oid应用程序我的、应用程序、字体、Roboto

2023-09-12 09:42:05 作者:千鸡变

你好我写一个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 :

安卓ICS排版

比方说,你想改变文本视图的字体:

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);