【发布时间】:2012-07-13 07:17:15
【问题描述】:
我正在开发一个需要支持两种语言(英语和印地语)的应用程序。我熟悉英语设计,但我不知道如何用印地语创建 UI。
谁能帮助我如何在印地语中创建 android UI ......? 我想要印地语中的以下 XML 文件表示代替名称和密码,如下图所示,我需要获取印地语单词..但我保留印地语文本意味着它显示框代替用户名和密码。正如你可以找到下面的按钮。创建了两个动态文本视图。英文文本正在准确显示,但出现在印地语文本显示框中。
main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layoutbase"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="30px"
android:text="Username"/>
<EditText
android:id="@+id/editText1"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</EditText>
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1" >
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="30px"
android:text="नमस्ते"/>
<EditText
android:id="@+id/editText2"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</EditText>
</TableRow>
</TableLayout>
输出如下图所示显示框
【问题讨论】:
-
您需要针对 Android 2.3 及更高版本。然后应该可以访问印地语字体。
-
是的,我使用的是 2.3,但不知道如何显示印地语字体。
-
根据这个错误报告,它不是在每个 2.3 设备上都起作用:code.google.com/p/android/issues/detail?id=4153 它应该适用于 ICS。该主题描述了如何在您的应用中使用您自己的字体:stackoverflow.com/questions/4395309/…
标签: android utf-8 localization android-resources