如何更改TextView的字体? [英] How to change the font on the TextView?

查看:211
本文介绍了如何更改TextView的字体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改一个的TextView ,因为默认情况下它显示了为宋体字体?如何将其更改为黑体

How to change the font in a TextView, as default it's shown up as Arial? How to change it to Helvetica?

推荐答案

首先,默认是不宋体。默认值是德罗伊德桑。

First, the default is not Arial. The default is Droid Sans.

二,更改为不同的内置字体,使用安卓字体在布局XML或 setTypeface() Java编写的。

Second, to change to a different built-in font, use android:typeface in layout XML or setTypeface() in Java.

三,没有Helvetica字体在Android中。内置的选择是德罗伊德桑( SANS ),德罗伊德桑单(等宽),和Droid的衬线(衬线)。虽然你可以捆绑自己的字体与您的应用程序,并通过 setTypeface(),记住,字体文件是很大的,在某些情况下,需要许可协议(例如,使用它们,黑体,一型活字字体)。

Third, there is no Helvetica font in Android. The built-in choices are Droid Sans (sans), Droid Sans Mono (monospace), and Droid Serif (serif). While you can bundle your own fonts with your application and use them via setTypeface(), bear in mind that font files are big and, in some cases, require licensing agreements (e.g., Helvetica, a Linotype font).

修改

Android的设计语言依赖于传统的排版工具   如尺度,空间,节奏,和对准与下面的网格。   成功部署这些工具是必不可少的,以帮助用户   快速了解信息的屏幕。为了支持这样使用   排版,冰淇淋三明治推出名为一种新型的家庭   Roboto,一个特别为用户界面的要求,并   高分辨率的屏幕。

The Android design language relies on traditional typographic tools such as scale, space, rhythm, and alignment with an underlying grid. Successful deployment of these tools is essential to help users quickly understand a screen of information. To support such use of typography, Ice Cream Sandwich introduced a new type family named Roboto, created specifically for the requirements of UI and high-resolution screens.

目前TextView的框架提供Roboto的薄,轻,经常   而大胆的权重,以及一个斜体每一个权重。该   框架还提供了Roboto简明变种经常和大胆   权重,以及一个斜体样式为每个重

The current TextView framework offers Roboto in thin, light, regular and bold weights, along with an italic style for each weight. The framework also offers the Roboto Condensed variant in regular and bold weights, along with an italic style for each weight.

在ICS安卓inculde Roboto字体的风格, 了解更多 Roboto

After ICS android inculde Roboto fonts style, Read more Roboto

这篇关于如何更改TextView的字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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