Is it possible to set a custom font for entire of application?

后端 未结 25 2665
日久生厌
日久生厌 2020-11-22 02:44

I need to use certain font for my entire application. I have .ttf file for the same. Is it possible to set this as default font, at application start up and then use it else

25条回答
  •  名媛妹妹
    2020-11-22 03:11

    For changing default font family of the TextViews, override textViewStyle in your app theme.

    For using custom font in fontFamily, use font resources which is in support library.

    The feature was added in Android 26 but backported to older versions via supportlib.

    https://developer.android.com/guide/topics/resources/font-resource.html https://developer.android.com/guide/topics/ui/look-and-feel/fonts-in-xml.html#using-support-lib

提交回复
热议问题