Write a Program to Create the Following form using the Table Layout.

 



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    tools:context=".MainActivity"
    >

    <TableLayout
        android:layout_height="match_parent"
        android:layout_width="match_parent"
        android:stretchColumns="*"
        >

        <TableRow
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <TextView
                android:gravity="center"
                android:text="Left Top"
                android:textSize="25dp"
                android:textStyle="bold" />

            <TextView
                android:gravity="center"
                android:text="Center Top"
                android:textSize="25dp"
                android:textStyle="bold" />

            <TextView
                android:gravity="center"
                android:text="Right Top"
                android:textSize="25dp"
                android:textStyle="bold" />

        </TableRow>

        <TableRow
            android:layout_marginTop="300dp"
            >

            <TextView
                android:text="Left Center"
                android:textSize="25dp"
                android:textStyle="bold"
                android:gravity="center"
                />

            <TextView
                android:text="Center"
                android:textSize="25dp"
                android:textStyle="bold"
                android:gravity="center"
                />

            <TextView
                android:text="Right Center"
                android:textSize="25dp"
                android:textStyle="bold"
                android:gravity="center"
                />

        </TableRow>

        <TableRow
            android:layout_marginTop="300dp"
            >

            <TextView
                android:text="Left Btm"
                android:textSize="25dp"
                android:textStyle="bold"
                android:gravity="center"
                />

            <TextView
                android:text="Center Btm"
                android:textSize="25dp"
                android:textStyle="bold"
                android:gravity="center"
                />

            <TextView
                android:text="Right Btm"
                android:textSize="25dp"
                android:textStyle="bold"
                android:gravity="center"     />
        </TableRow>

    </TableLayout>

</LinearLayout

Output:


Comments

Popular posts from this blog

Write a program to create a first display screen on any search engine using auto complete text View

Write a Program to create a toggle button to display the ON/OFF Bluetooth on the display screen.

Write a program to create a login form for social networking website.