显示非英语(特别是印地文)在Android设备上的字符特别是、英语、字符、设备

由网友(有种谎言叫逆着光悲伤°)分享简介:我是新android开发。我有一个是没有得到显示的虚拟设备上一些印地文文本。该文本是正确显示在Eclipse中,而文件是UTF-8 EN codeD。I am new to android development. I have some hindi text which is not getting display...

我是新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);
阅读全文

相关推荐

最新文章