How to create 3 equally wide TextView which fill parent across the screen

Posted by hap497 on Stack Overflow See other posts from Stack Overflow or by hap497
Published on 2010-05-11T20:31:35Z Indexed on 2010/05/11 20:34 UTC
Read the original article Hit count: 229

Filed under:

HI,

Can you please tell me how can I create 3 equally wide TextView which fill parent across the screen? I tried doing this, but the width of the TextView are different: it is 149, 89, 89.

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent" android:layout_height="wrap_content"
     android:stretchColumns="*"
     android:shrinkColumns="*">

<TextView android:id="@+id/t1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_column="0"/>

<TextView android:id="@+id/t2"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_column="1"/>

<TextView android:id="@+id/t3"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_column="2"/>

© Stack Overflow or respective owner

Related posts about android