我有这个表格布局,前两行有 2 行,第三行有一行(customerAddress),我想右对齐并占用所有空间。我怎样才能做到这一点。我试过gravity = right
但没有运气。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stretchColumns="*" >
<TableRow>
<TextView
style="@style/CustomerLabelTextView"
android:gravity="right"
android:text="@string/customerCode" />
<TextView
style="@style/CustomerLabelTextView"
android:gravity="right"
android:text="@string/customerName" />
</TableRow>
<TableRow>
<TextView
android:id="@+id/customerCode"
style="@style/CustomerTextView"
android:gravity="right" />
<TextView
android:id="@+id/customerName"
style="@style/CustomerTextView"
android:gravity="right" />
</TableRow>
<TableRow>
<TextView
style="@style/CustomerLabelTextView"
android:gravity="right"
android:text="@string/customerAddress" />
</TableRow>
<TableRow>
<TextView
android:id="@+id/customerAddress"
style="@style/CustomerTextView"
android:gravity="right" />
</TableRow>
<TableRow>
<TextView
style="@style/CustomerLabelTextView"
android:gravity="right"
android:text="@string/OrganizationName" />
<TextView
style="@style/CustomerLabelTextView"
android:gravity="right"
android:text="@string/POBox" />
</TableRow>
<TableRow>
<TextView
style="@style/CustomerLabelTextView"
android:gravity="right"
android:text="@string/phone" />
<TextView
style="@style/CustomerLabelTextView"
android:gravity="right"
android:text="@string/fax" />
</TableRow>
</TableLayout>