我有這個表格佈局,其中第一行兩行有兩行,我在第三行(customerAddress)有一行,我想要對齊並佔據所有空間。我怎樣才能做到這一點。我試過gravity = right
,但沒有運氣。TableLayout問題
<?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>
請給出更多信息併發布您的styles.xml文件。 –
'<樣式名稱= 「CustomerAddressTextView」> <項名稱= 「機器人:layout_width」> FILL_PARENT <項目名= 「機器人:layout_height」> WRAP_CONTENT <項目名= 「機器人:TEXTSIZE」> 16SP <項目名稱= 「機器人:文字顏色」> @機器人:顏色/白色 <項目名= 「機器人:layout_margin」> 5DP <項目名= 「機器人:背景」> @繪製/ textview_border ' – ZAJ
任何人..請幫助 – ZAJ