我正在开发在 TextView 中具有古吉拉特字体的应用程序,但我的问题是在 TextView 中它显示的是框而不是我尝试过的“TypeFace”古吉拉特字体,并且文本位于 string.xml 但它是无法工作,请帮助我,我必须在周二在学校提交,所以请帮助我
提前谢谢
TextView cap = (TextView) view.findViewById(R.id.caption);
Typeface tf = Typeface.createFromAsset(getAssets(),"fonts/gujaratifont.ttf");
cap.setTypeface(tf);
cap.setText(R.string.gujarati);
最佳答案
将文件拖放到 Assets 文件夹中。
尝试这样做。 getResources().getString(R.string.gujarati);
其原因之一是资源无法到达 TextView。只需检查一下即可。
关于古吉拉特语字体的 Android 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9962955/