Android TextView无法在HTC NEW ONE中正确显示如下: 正确的单词被截断(仅限HTC NEW ONE)
我的xml代码如下:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:paddingLeft="5dp" android:paddingRight="5dp" android:paddingTop="3dp"
android:paddingBottom="3dp"
android:background="@layout/date_bar">
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:paddingLeft="5dp"
android:paddingRight="5dp" android:paddingTop="4dp" android:paddingBottom="5dp"
android:background="@layout/round_corner">
<ImageView android:id="@+id/left_arrow" android:visibility="gone"
android:scaleType="fitCenter" android:layout_height="wrap_content"
android:layout_width="14dp" android:src="@drawable/arrowleft"
android:layout_alignParentLeft="true" android:layout_centerVertical="true"
android:paddingRight="3dp" />
<ImageView android:id="@+id/right_arrow" android:visibility="gone"
android:scaleType="fitCenter" android:layout_height="wrap_content"
android:layout_width="14dp" android:src="@drawable/arrowright"
android:layout_alignParentRight="true" android:layout_centerVertical="true"
android:paddingLeft="3dp" />
<ImageView android:id="@+id/summary_page_battery"
android:layout_toLeftOf="@id/right_arrow" android:scaleType="fitCenter"
android:adjustViewBounds="true" android:visibility="visible"
android:layout_height="80sp" android:layout_width="wrap_content"
android:layout_alignWithParentIfMissing="true" />
<TextView android:id="@+id/summary_page_title" style="@style/SummaryPageTitleStyle"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentTop="true" android:layout_toRightOf="@id/left_arrow" />
<TextView android:id="@+id/summary_page_date" style="@style/SummaryPageTitleStyle"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:gravity="right"
android:singleLine="true"
android:lines="1"
android:layout_toLeftOf="@id/summary_page_battery"
android:layout_toRightOf="@id/summary_page_title"
android:layout_alignWithParentIfMissing="true" />
<TextView android:id="@+id/summary_page_item1_label" style="@style/SummaryPageItemNormalStyle"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:ellipsize="end"
android:layout_toRightOf="@id/left_arrow" android:layout_below="@id/summary_page_date" />
<TextView android:id="@+id/summary_page_item1_content"
android:layout_alignWithParentIfMissing="true" android:gravity="right"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:layout_below="@id/summary_page_date" android:paddingLeft="8dp"
android:singleLine="true" android:ellipsize="middle"
android:layout_toLeftOf="@id/summary_page_battery"
android:layout_toRightOf="@id/summary_page_item1_label" />
<TextView android:id="@+id/summary_page_item2_label" style="@style/SummaryPageItemNormalStyle"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:ellipsize="end"
android:layout_toRightOf="@id/left_arrow" android:layout_below="@id/summary_page_item1_label" />
<TextView android:id="@+id/summary_page_item2_content"
android:gravity="right" android:layout_alignWithParentIfMissing="true"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_toLeftOf="@id/summary_page_battery"
android:layout_below="@id/summary_page_item1_content"
android:paddingLeft="8dp" android:singleLine="true"
android:ellipsize="middle" android:layout_toRightOf="@id/summary_page_item2_label" />
<TextView android:id="@+id/summary_page_item3_label" style="@style/SummaryPageItemNormalStyle"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:ellipsize="end"
android:layout_toRightOf="@id/left_arrow" android:layout_below="@id/summary_page_item2_label" />
<TextView android:id="@+id/summary_page_item3_content"
android:paddingLeft="8dp" android:layout_alignWithParentIfMissing="true"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_toLeftOf="@id/summary_page_battery"
android:layout_below="@id/summary_page_item2_content"
android:gravity="right" android:singleLine="true" android:ellipsize="middle"
android:layout_toRightOf="@id/summary_page_item3_label" />
</RelativeLayout>
</RelativeLayout>
我的代码出了什么问题?我在我的手机和各种模拟器上试了一下。一切正常。我不知道如何解决它
答案 0 :(得分:0)
实际上它有时取决于设备,因此您必须通过更改文本大小等来调整文本或尝试更改文本的字体类型。 这可能会有所帮助。
答案 1 :(得分:0)
请注意左侧的paddingRight
和/或marginRight
TextViews
或marginLeft
和/或paddingLeft
ImageView
}