Custom fonts and XML layouts (Android)

后端 未结 18 1899
执念已碎
执念已碎 2020-11-22 07:21

I\'m trying to define a GUI layout using XML files in Android. As far as I can find out, there is no way to specify that your widgets should use a custom font (e.g. one you\

18条回答
  •  花落未央
    2020-11-22 07:25

    I'm 3 years late for the party :( However this could be useful for someone who might stumble upon this post.

    I've written a library that caches Typefaces and also allow you to specify custom typefaces right from XML. You can find the library here.

    Here is how your XML layout would look like, when you use it.

    
    

提交回复
热议问题