按照 Android Studio 3 中使用字体的新方式,我在 res 中添加了字体资源文件夹,并在其中添加了我的 .ttf
字体,然后在 xml 文件中引用它们,如下所示:
<TextView
android:id="@+id/tv_about"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:text="@string/about_info"
android:textColor="@color/tin"
android:textSize="23sp"
android:fontFamily="@font/diana" />
编译正常但不工作,字体没有改变。
最佳答案
您需要针对 API 级别 26+ (Oreo) 并安装支持库 26.0.0+ 才能应用 res/font 中的字体。
关于android - 使用 "font"资源文件的 Android 字体未更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46080350/