Android TableLayout with ImageView

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >
 
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="States of The USA" />
 
    <TableLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content">
        <TableRow>
 
            <ImageView
                android:id="@+id/imageView1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/california" />
 
            <ImageView
                android:id="@+id/imageView2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/nevada" />
 
            <ImageView
                android:id="@+id/imageView3"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/washington" />
 
              <ImageView
                android:id="@+id/imageView5"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ohio" />
 
 
        </TableRow>
        <TableRow>
 
 
            <ImageView
                android:layout_column="1"
                android:id="@+id/imageView4"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/northcarolina" />
 
            <ImageView
                android:layout_column="3"
                android:id="@+id/imageView6"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/southcarolina" />
 
        </TableRow>
        <TableRow>
 
            <ImageView
                android:id="@+id/imageView7"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/newyork" />
 
            <ImageView
                android:id="@+id/imageView8"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/idaho" />
 
            <ImageView
                android:id="@+id/imageView9"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/minnesota" />
 
        </TableRow>
 
    </TableLayout>
 
</LinearLayout>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.