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

后端 未结 25 2983
日久生厌
日久生厌 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:07

    in api 26 with build.gradle 3.0.0 and higher you can create a font directory in res and use this line in your style

    @font/your_font
    

    for change build.gradle use this in your build.gradle dependecies

    classpath 'com.android.tools.build:gradle:3.0.0'
    

提交回复
热议问题