I am developing a screen that uses TableLayout . Here I can easily create two columns. but how can i create three columns?
TableLayout
Here is an example:
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:stretchColumns="1"> <TableRow> <TextView android:text="first" android:padding="3dip" /> <TextView android:text="second" android:gravity="center" android:padding="3dip" /> <TextView android:text="third" android:gravity="right" android:padding="3dip" /> </TableRow> <TableRow> <TextView android:text="first" android:padding="3dip" /> <TextView android:text="second" android:gravity="center" android:padding="3dip" /> <TextView android:text="third" android:gravity="right" android:padding="3dip" /> </TableRow> </TableLayout>
For each TableRow, you need to add three children instead of two. That should be good for you!
Hope this helps!