How to set custom font in .xml file instead of .java file?

前端 未结 8 506
無奈伤痛
無奈伤痛 2020-12-05 10:14

I am creating one Application in which I want to set custom font.

But I can\'t use custom Fonts in .xml file, for using this I need to initialize each and every Text

8条回答
  •  时光说笑
    2020-12-05 10:38

    Extend a custom class from TextView and customise font in the class. Then you would be able to use that custom textview class in you xml and you won't need to customize fonts dynamically in your code.

    Good luck.

提交回复
热议问题