Using custom font in android TextView using xml

前端 未结 10 1062
执念已碎
执念已碎 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条回答
  •  遥遥无期
    2020-11-29 17:52

    instead of xmlns:custom="schemas.android.com/tools"; you should use: xmlns:custom="schemas.android.com/apk/res-auto"; in order to use styleable attributes. I made this change and it is working now.

提交回复
热议问题