Roboto字体在我的Android应用程序中

Rah*_*him 5 fonts android

嗨,我正在写一个Android应用程序.而且无论手机的版本如何,我都想要roboto字体.有办法吗?

谢谢,拉希姆.

Ren*_*eno 18

是的为什么不,你可以得到Roboto字体:

Android ICS排版

假设您要更改文本视图的字体:

   Typeface tf = Typeface.createFromAsset(getAssets(),
            "fonts/Roboto-Black.ttf");
    TextView tv = (TextView) findViewById(R.id.FontTextView);
    tv.setTypeface(tf);
Run Code Online (Sandbox Code Playgroud)

  • 有没有办法在XML本身中设置此字体属性?或者更简单地说,在AndroidManifest.xml本身中,要在整个应用程序中使用? (6认同)