我在一部手机上遇到了问题(到目前为止)。我的应用程序使用印地语字体。它在模拟器、选项卡和许多其他手机上也显示良好。但是我用于测试目的的其中一部手机显示的文字是从侧面切掉的。
我尝试了几乎所有的方法来将它按正确的顺序排列,但没有一个奏效。这里贴出我的两部测试手机的截图和文字。
错误截图:
其他手机的截图:和预期的一样:
可能是什么原因,我该如何解决?请告诉我!!
我正在使用的 TextView 配置:
<TextView
android:id="@+id/A_lbl_mandir"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/Abt_mandir"
android:textAlignment="center"
android:textColor="#80000A"
android:textSize="35sp" />
编辑:我完整的 Activity xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<TextView
android:layout_width="wrap_content"
android:id="@+id/text"
android:layout_height="wrap_content"
android:textSize="20sp"
android:text="@string/hello_world" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_below="@id/text" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:padding="5sp"
android:text="@string/test"/>
</ScrollView>
</RelativeLayout>
我已经尝试并删除了许多其他内容,特别是针对这部手机。但是无法解决问题!
最佳答案
这发生在 4.1.2 中,在 Google 中被记录为错误,他们已在 4.2 中修复。
https://code.google.com/p/android/issues/detail?id=34432
Android 操作系统无法计算文本长度的 unicode 字体会发生这种情况。
关于Android 文本在某些设备上被截断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22577552/