如何在Android的改变TextView中的fontFamily中如何在、Android、fontFamily、TextView

由网友(说不出口的思念.....)分享简介:所以我想修改安卓fontFamily中在Android的,但我看不出有任何的Andr​​oid pre定义的字体。如何选择的pre定义的人吗?我并不真的需要定义自己的字体,但所有我需要的是从它表明现在不同。So I like to change the android:fontFamily in Android bu...

所以我想修改安卓fontFamily中在Android的,但我看不出有任何的Andr​​oid pre定义的字体。如何选择的pre定义的人吗?我并不真的需要定义自己的字体,但所有我需要的是从它表明现在不同。

So I like to change the android:fontFamily in Android but I don't see any pre-defined fonts in Android. How to select one of the pre-defined ones? I don't really need to define my own TypeFace but all I need is something different from what it shows right now.

<TextView
    android:id="@+id/HeaderText"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="52dp"
    android:gravity="center"
    android:text="CallerBlocker"
    android:textSize="40dp"
    android:fontFamily="Arial"
 />

看来我就是这样做起来不会有真正的工作! BTW 安卓!fontFamily中=宋体是一个愚蠢的企图

推荐答案

从安卓4.1 / 4.2 / 5.0,以下 Roboto字体的家庭可用:

From android 4.1 / 4.2 / 5.0, the following Roboto font families are available:

android:fontFamily="sans-serif"           // roboto regular
android:fontFamily="sans-serif-light"     // roboto light
android:fontFamily="sans-serif-condensed" // roboto condensed
android:fontFamily="sans-serif-thin"      // roboto thin (android 4.2)
android:fontFamily="sans-serif-medium"    // roboto medium (android 5.0)

与组合

android:textStyle="normal|bold|italic"

这14变型是可能的:

Roboto常规 Roboto斜体 Roboto粗体 Roboto粗斜体 Roboto光强 Roboto光强斜体 Roboto薄 Roboto薄斜体 Roboto冷凝 Roboto冷凝斜体 Roboto冷凝粗体 Roboto冷凝粗斜体 Roboto-中 Roboto介质斜体 Roboto regular Roboto italic Roboto bold Roboto bold italic Roboto-Light Roboto-Light italic Roboto-Thin Roboto-Thin italic Roboto-Condensed Roboto-Condensed italic Roboto-Condensed bold Roboto-Condensed bold italic Roboto-Medium Roboto-Medium italic
阅读全文

相关推荐

最新文章