有兩個TableRows在TableLayout,並且每個的TableRow包含兩個TextViews:TextView的對準
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" >
<TextView
android:id="@+id/textTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/textTitle"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp" />
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="63dp"
android:layout_marginRight="10dp" >
<TextView
android:id="@+id/textHall"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/textPrice"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp" />
</TableRow>
</TableLayout>
如果textHall
包含一個短Word
,textTitle
(Some Text
)位於正確的位置:
但如果textHall
包含一個長Second Word
,textTitle
之前(Some Text
)出現一個大缺口:
的原因是什麼?
謝謝。