2010-09-17 99 views
4

我想在TableLayout中顯示一些ImageView和TextView。TableRow中的TextView部分隱藏

但是,對於TextView(在第二列中),它是部分隱藏的,不會進入下一行。

附加屏幕截圖here

<TableLayout android:id="@+id/RestTable" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:background="#D1D3D4" 
android:layout_marginTop="5dp" 
android:stretchColumns="*" 
> 
<TableRow android:id="@+id/row1 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:layout_marginBottom="0.3dp" 
android:background="#ffffffff" 
> 
<ImageView android:id="@+id/tickPic" 
    android:layout_marginLeft="13dp" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:src="@drawable/tickPic" 
    android:scaleType="matrix" 
/> 
<TextView 
    android:id="@+id/meal" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:textSize="13sp" 
    android:text="Dinner, Lunch, Buffet, Brunch, Hi Tea, Supper/Night Dining" 
    android:textColor="#000000" 

/> 
</TableRow> 

TextView是否可以包裝內容並將文本移動到下一行而不是部分隱藏?

我試過使用android:layout_marginRight,但沒有解決任何問題。

回答

7

TableLayout允許其內容溢出。只需將android:shrinkColumns =「*」或 android:shrinkColumns =「1」添加到TableLayout,它就可以解決您的問題。