我创造阿拉伯语 的应用程序,并有一个我想使用 自定义字体可有人告诉我,我的代码应该用我的java class 我试过
TextView txt = (TextView) findViewById(R.id.custom_font);
Typeface font = Typeface.createFromAsset(getAssets(), "trado.ttf");
txt.setTypeface(font);
但是结尾线说,字体theres一个错误,说 令牌“字体”的语法错误,VariableDeclaratorId预计在此令牌后 有人可以帮助!
重复的文章,请参阅Android - 使用自定义字体http://stackoverflow.com/q/3651086/594773 – 2012-03-10 20:15:12
这里的一切都很好,您是否已将字体添加到资源文件夹? – 2012-03-10 20:16:29
是的,我做了,但我得到一个错误! – user1223679 2012-03-10 20:18:28