2

Following the new way of using fonts in Android Studio 3, I added font resource folder in res and added my .ttf fonts in it, then referencing them in the xml file like this:

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

Compiles fine but doesn't work, the font isn't changing.

fullmoon
  • 8,030
  • 5
  • 43
  • 58

1 Answers1

1

You need to targeting on API level 26+ (Oreo) and support library 26.0.0+ installed in order to apply the font inside res/font.

nyconing
  • 1,092
  • 1
  • 10
  • 33