Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TextView in TableRow is partially hidden

I am trying to display some ImageView and TextView in a TableLayout.

However, for the TextView (in the second column), it is partially hidden and does not go to the next line.

A screen capture is attached 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>

Is it possible for the TextView to wrap the content and move the text to the next line instead of being partially hidden?

I tried using android:layout_marginRight but doesn't solve anything.

like image 255
Ted Avatar asked Jan 22 '23 10:01

Ted


1 Answers

TableLayout lets its content overflow. Just add android:shrinkColumns="*" or android:shrinkColumns="1" to the TableLayout and it will fix your problem.

like image 86
ataulm Avatar answered Jan 28 '23 15:01

ataulm