Take the 2-minute tour ×

I've got a small clipping problem that I haven't been able to solve using an EditText view in a TableRow. Whatever I try, the EditText view is either clipped (attached screenshot), or, if I set shrinkColumns to either 0 or 1, the label text disappears (and the EditText view takes up the whole width). The layout is as follows:

android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical" android:padding="10dip">

  <TableLayout android:orientation="vertical"
  android:layout_width="fill_parent" android:layout_height="fill_parent">

    <TableRow android:orientation="horizontal"
    android:layout_width="fill_parent" android:layout_height="wrap_content">

      <TextView android:paddingRight="10dip" android:layout_column="1"
      android:text="Label Text" />
      <EditText android:text="Very long text that makes the text view go on clipping frenzy"
      android:layout_width="wrap_content" android:layout_height="wrap_content" />




I've tried it on a 2.2 emulator running at QVGA and HVGA, a HTC Hero on 2.1 and the Wildfire on 2.1 as well. I've also played around with the clipToPadding attribute which doesn't seem to help in my case. The same issue appears if I set the hint attribute with a long text and leave the text value empty.

As I am doing nothing particularly complex, I suspect a simple error on my side. Any ideas, hints or suggestions are highly appreciated.


alt text

share|improve this question
you should first try to accept some answer, it is good for you to have answer rapidly –  Paresh Mayani Nov 15 '10 at 12:13

2 Answers 2

up vote 7 down vote accepted

Set android:shrinkColumns="1" on your TableLayout, and remove android:layout_column="1" from the TextView.

share|improve this answer
Thank you! That worked perfectly. I ended up using setColumnShrinkable(1, true) to avoid shrinking the label. –  Alpha Hydrae Nov 16 '10 at 7:39

Add android:layout_weight="1", to your EditText, It took a while to resolve it..........

But don't know the reason for it.......

share|improve this answer

Your Answer


