set custom font through xml

后端 未结 5 1744
忘掉有多难
忘掉有多难 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

    If you create your own TextView derivation, you could add an XML-attribute that the class handles the programmatical way. That way, you specify a certain font and it'll be set runtime, but you do it via XML. :)

    Otherwise, there's no known way to achieve the requested behaviour.

提交回复
热议问题