android如何实现加载本地字体

   我们在做项目的时候,大部分都会遇到这个需求,如何更改APP的字体,使用我们自己规定的字体,来实现更好的APP的体验,以及展示效果。下面我就分享一下,目前我用到的方法。

1:在res目录下面 创建 font 字体文件夹,并把我们要用的字体方进去。

2:在Style文件下配置字体

3:运用

<TextView
    style="@style/Medium_TextView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerVertical="true"
    android:layout_marginLeft="15dp"
    android:text="xiebin"
    android:textColor="#232323"
    android:textSize="15sp" />

这就是我目前项目中,更改字体的方法,还是蛮简单的。

猜你喜欢

转载自blog.csdn.net/qq_35153556/article/details/106620297