TableLayout stretchColumns : TableLayout « UI « Android






TableLayout stretchColumns

  

package app.test;

import android.app.Activity;
import android.os.Bundle;

public class Test extends Activity {
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
      }
}

//main.xml



<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"  android:layout_height="fill_parent"
    android:stretchColumns="0,1,2" >

  <EditText android:text="Fullname:"
        android:layout_width="wrap_content"  android:layout_height="wrap_content" />

  <TableRow>
    <TextView android:text="Edgar"
        android:layout_width="wrap_content"  android:layout_height="wrap_content" />

    <TextView android:text="Allen"
        android:layout_width="wrap_content"  android:layout_height="wrap_content" />

    <TextView android:text="Poe"
        android:layout_width="wrap_content"  android:layout_height="wrap_content" />
  </TableRow>

</TableLayout>

   
    
  








Related examples in the same category

1.Switch to a TableLayout
2.Using TableLayout and TableRow to display color
3.Using TableLayout to create input form
4.TableLayout and TableRow
5.TableLayout and padding
6.gravity setting inside a TableLayout
7.Code based TableLayout
8.Adding view to TableLayout
9.Shrink a TableLayout
10.Table layout demo
11.Stretch some columns
12.Horizontally centers the content of the cell