【发布时间】:2014-04-29 22:18:43
【问题描述】:
我在一部手机中遇到问题(直到现在)。我的应用程序使用印地语字体。它在模拟器、选项卡和许多其他手机上也能很好地显示。但是我用于测试目的的一部手机显示文字从侧面切开。
我几乎尝试了所有方法来将其按正确的顺序排列,但都没有奏效。这里贴出我的两部测试手机的截图和文字。
有错误的截图:
其他手机的截图:和预期的一样:
可能是什么原因,我该如何解决?请告诉我!!
我正在使用的 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" />
编辑:我的完整活动 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>
我已经尝试并删除了许多其他东西,尤其是这款手机。但无法解决问题!
【问题讨论】:
-
谢谢维格!得到了低分,所以无法发布图片。 :)
-
你试过了吗? textView.setText(Html.fromHtml(yourtext));
-
是的!我也通过 setText 尝试过....但文本仍然被剪辑
-
我希望你在使用 setText 时尝试过 Html.fromHtml。
-
是的,我做到了。我的输出很好...... setText(Html.fromHtml(text)) 使用没有错误,我唯一的问题是文本切割。 n 那也是,印地语文本,n 那仅适用于特定电话。在我的其他手机或模拟器中,它工作得很好......上面的两个屏幕截图都是两部不同的手机,其中一个我遇到了问题,第二个是我在其他手机和模拟器上得到的预期和输出。跨度>
标签: android text textview clip