首页 > 代码库 > java.lang.RuntimeException: native typeface cannot be made

java.lang.RuntimeException: native typeface cannot be made


设置字体出错:

txt.setTypeface(Typeface.createFromAsset(getAssets(),"fonts/luculent"));
然后发现,竟然是因为自己没有加上后缀,改成下面这样就好了

txt.setTypeface(Typeface.createFromAsset(getAssets(),"fonts/luculent.ttf"));

出这个错误了先看看名字有没有写全