我正在使用TableLayout來顯示數據。 當活動調用onCreate()時,右列的TextView的文本將被設置。Android TableLayout寬度問題
現在,您可以在下圖中看到我的地址文本可以很長並且應該被包裹。 所以我設置了android:layout_width="wrap_content"
。但它仍然需要一個屏幕大小的寬度來包裝數據。 如何克服這個問題?
我的XML:
<?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="fill_parent"
android:padding="5px">
<TableRow>
<TextView android:text="Job#"
android:paddingRight="5px" />
<TextView android:id="@+id/DetailJobNo" />
</TableRow>
<TableRow>
<TextView android:text="Address"
android:paddingRight="5px" />
<TextView android:id="@+id/DetailAddress"
android:layout_width="wrap_content"
android:text="Address Address Address Address Address Address Address Address "/>
</TableRow>
</TableLayout>
好吧,看起來你已經解決了你的問題!乾杯,indyfromoz – indyfromoz 2011-01-07 07:31:14