2011-12-07 64 views

回答

2

嘗試這樣:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" android:layout_height="fill_parent" 
    android:orientation="vertical"> 
    <TableLayout android:layout_width="fill_parent" 
     android:layout_height="wrap_content" android:stretchColumns="*" 
     android:id="@+id/tableLayout1"> 
     <TableRow android:id="@+id/tableRow1" android:layout_width="fill_parent" 
      android:layout_height="wrap_content"> 
      <TextView android:text="test1" android:layout_width="fill_parent" 
       android:layout_height="wrap_content" android:layout_weight="0" /> 
      <TextView android:layout_weight="1" 
       android:text="test2 very long text that needs to be wrapped properly using layout_weight property and ignoring singleline since that is set by default..." 
       android:layout_width="fill_parent" android:layout_height="wrap_content" /> 
     </TableRow>  
    </TableLayout> 
</LinearLayout> 
0

設置一個固定的寬度到您的TextView,一切都應該工作...

相關問題