【发布时间】:2019-02-01 03:15:13
【问题描述】:
我正在尝试使用字体资源目录并在 xml 文件中使用不同的字体,以便优先使用它们。我读了这个thread,但我无法解决问题。我正在使用支持库 v27,我知道它支持 res 中的字体而不是资产文件夹。每当我更改应用程序的语言时,它只使用位于 font-fa-rIR 文件夹中的字体。我希望应用程序分别为不同类型的语言使用不同的字体。我从应用程序的 res 目录中附加了一张图片。我的问题在哪里?我该如何解决?提前致谢。
preference_button.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="8dp">
<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/font_1" />
<TextView
android:id="@+id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/font_1" />
</LinearLayout>
【问题讨论】:
标签: android locale android-resources android-fonts