如何在android中的文本视图中写入hindi

var*_*run 1 android textview android-resources

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

TextView tv = new TextView(this);
tv.setText("HEllo Android");
Run Code Online (Sandbox Code Playgroud)

在这里,我用英语写了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/>
Run Code Online (Sandbox Code Playgroud)

任何帮助都会感激.

小智 5

下载OTF hindi文件并将其放入assets文件夹.在活动中运行代码

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