显示非英语(特别是印地文)在Android设备上的字符 [英] Displaying non-English (specifically Hindi) characters on android device
本文介绍了显示非英语(特别是印地文)在Android设备上的字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是新android开发。我有一个是没有得到显示的虚拟设备上一些印地文文本。该文本是正确显示在Eclipse中,而文件是UTF-8 EN codeD。
I am new to android development. I have some hindi text which is not getting displayed on the virtual device. The text is properly displayed in eclipse, and the files are utf-8 encoded.
例如。我有这个资源文件:
E.g. I have this resource file:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello World, Jain_aartisActivity!</string>
<string name="app_name">जैन आरती संग्रेह</string>
</resources>
但AVD无法显示APP_NAME。它只是显示一个小矩形为每个印地文字符。
But the AVD is unable to display the app_name. It just displays a small rectangle for each hindi character.
任何帮助吗?
推荐答案
试试这个::
在这里我有我的TextView中设置印地文字体。您可以复制的资产文件夹文件,并应用以下code:
here i have set hindi font in my textview. you can copy file in assets folder and apply following code :
Typeface face;
face = Typeface.createFromAsset(this.getAssets(), "fonts/hindi.TTF");
tran_banner = (TextView) findViewById(R.id.tran_banner);
tran_banner.setTypeface(face, Typeface.BOLD);
这篇关于显示非英语(特别是印地文)在Android设备上的字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文