2010-09-17 102 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,它就可以解决您的问题。