Roboto字体在我的Android应用程序 [英] Roboto font in my android app

查看:114
本文介绍了Roboto字体在我的Android应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好我正在写一个Android应用程序。而且我想要roboto字体,不管手机的版本如何。有没有办法?



谢谢,
Rahim。

解决方案

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


Android ICS排版


让我们说您要更改文本视图的字体:

  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 :

Android ICS typography

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆