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
Post a Comment