Android Runtime Exception font asset not found

后端 未结 13 665
执念已碎
执念已碎 2021-01-04 01:11

Here is my code and screenshot I\'m trying to set custom font typeface but Runtime exception occurs font asset not found while font file is in asset folder. Am I missing som

13条回答
  •  迷失自我
    2021-01-04 01:48

    Your font asset folder is named incorrectly. You should name the folder as fonts not as font. Also change your code:

    Typeface font = Typeface.createFromAsset(getAssets(), "fonts/terminal.ttf");
    

提交回复
热议问题