【问题标题】:Font Is Not Changing In Android Using "font" Resource File使用“字体”资源文件在 Android 中字体未更改
【发布时间】:2017-09-06 16:36:34
【问题描述】:

按照 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" />

编译正常但不起作用,字体没有改变。

【问题讨论】:

标签: android android-resources android-fonts


【解决方案1】:

您需要针对 API 级别 26+ (Oreo) 并安装支持库 26.0.0+ 才能在 res/font 中应用字体。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-07
    • 2014-04-10
    相关资源
    最近更新 更多