Using custom font in android TextView using xml

前端 未结 10 1071
执念已碎
执念已碎 2020-11-29 17:02

I have added a custom font file to my assets/fonts folder. How do I use it from my XML?

I can use it from code as follows:

TextView text =          


        
10条回答
  •  萌比男神i
    2020-11-29 17:57

    Not a good idea to use custom fonts in xml due to this fact that is, you have to do it programmatically to avoid the memory leak!

提交回复
热议问题