Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我很难显示完整的 urdu 单词。我的代码在我的 android 模拟器中逐个字母地显示 urdu 文本。请指导我如何阅读乌尔都语。我已经设置了 URDU 字体。谢谢
获取一个像“urdu.ttf”这样的字体文件将它放在你的资产文件夹中,在一个“fonts”文件夹中获取TextView的引用,如下所示:
TextView tv = (TextView) findViewById(R.id.myCustomTVFont);
从资产文件夹中获取字体:
Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/urdu.ttf");
让您的 TextView 看起来很棒:
tv.setTypeface(tf);