如何在android中的文本视图上用印地语写作



是否可以在android的文本视图中使用另一种语言字体编写例如,我创建了

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 hindi文件并将其放入assets文件夹中。在活动中运行代码

Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/hindi.otf");
TextView tv = (TextView) findViewById(R.id.CustomFontText);
tv.setTypeface(tf)

当然可以。当然,这是可能的,要么你可以执行本地化,要么直接将文本设置到电视中。setText("हेल्लो");如果你将图像,它将得到模糊

最新更新