Create the below form using 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"
    tools:context=".MainActivity"
    android:orientation="vertical">
<TableLayout
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:stretchColumns="*"
        android:layout_marginTop="20dp">
<TableRow>
        <TextView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:gravity="center"
                android:text="Column 1"
                android:textSize="27dp"
                android:layout_span="3"/>

</TableRow>
<TableRow>
        <TextView
                android:text="Column 2"
                android:textSize="25dp"
                android:gravity="center"
                android:layout_span="2"/>
        <TextView
                android:text="Column 3"
                android:textSize="25dp"
                android:gravity="center"/>

</TableRow>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center"
            android:text="Column 4"
            android:textSize="27dp"
            android:layout_span="3"/>
</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.