RuntimeException: native typeface cannot be made or memory leak for custom TextView loading font

后端 未结 4 1254
没有蜡笔的小新
没有蜡笔的小新 2021-01-03 08:07

There\'s a HUGE problem in my code wherein I am loading a font in my assets\\fonts\\ folder from a custom TextView class. The first problem is that

4条回答
  •  走了就别回头了
    2021-01-03 08:22

    If you're having this issue on Android Studio then put your assets under main directory instead of putting it under res directory.

    Also in font naming use lowercase letters and underscores only, e.g. my_font.ttf

    That worked like charm for me

提交回复
热议问题