set custom font through xml

后端 未结 5 1781
忘掉有多难
忘掉有多难 2021-01-07 09:17

how can i set a font, whose ttf resides in my assets folder through xml? I know how to do that programmatically but how can you do that via xml? Thanks in adva

5条回答
  •  灰色年华
    2021-01-07 10:01

    I have created a library to solve this problem here: http://responsiveandroid.com/2012/03/15/custom-fonts-in-android-widgets.html

    You extend a TextView and set the name of the typeface in the xml. There is a downloadable sample.

提交回复
热议问题