【发布时间】:2014-02-14 14:57:53
【问题描述】:
这是布局:
<?xml version="1.0" encoding="utf-8"?>
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:columnCount="2"
android:rowCount="2"
android:rowOrderPreserved="true"
android:alignmentMode="alignMargins">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_row="0"
android:layout_column="0"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Test:" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_row="0"
android:layout_column="1"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="too long line too long line too long line too long line" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Test2:"
android:paddingRight="10dp"
android:layout_row="1"
android:layout_column="0" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_row="1"
android:layout_column="1"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Test line" />
</GridLayout>
这里是发生了什么的屏幕截图:
如何防止第二个 TextView(屏幕截图中选择的那个)越过屏幕边界?
【问题讨论】: