是否可以在android中的 TextView 中用另一种语言字体书写 例如我创建了
TextView tv = new TextView(this);
tv.setText("HEllo Android");
这里我用英文写了 Hello Android 我怎么能用印地语写呢。
我用过图像,效果很好
<ImageView android:id ="@+id/header2"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_gravity="center"
android:paddingTop="0dip"
android:src="@drawable/why00learn00spanish_index"
>
<ImageView/>
任何帮助将不胜感激。
最佳答案
下载 OTF 印地文文件并将其放入 assets 文件夹中。在 Activity 中运行代码
Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/hindi.otf");
TextView tv = (TextView) findViewById(R.id.CustomFontText);
tv.setTypeface(tf)
关于android - 如何在android中的 TextView 上用印地语书写,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9209633/