Create the below form using Frame Layout.

 



<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">
<TextView
        android:text="Left Top"
        android:textSize="25dp"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_gravity="left|top"/>
<TextView
        android:text="Center Top"
        android:textSize="25dp"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_gravity="center|top"/>
<TextView
        android:text="Right Top"
        android:textSize="25dp"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_gravity="right|top"/>
<TextView
        android:text="Left Center"
        android:textSize="25dp"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_gravity="left|center"/>
<TextView
        android:text="Center"
        android:textSize="25dp"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_gravity="center" />

 

 

 

 

 

 

 

 

<TextView
        android:text="Right Center"
        android:textSize="25dp"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_gravity="right|center"/>
<TextView
        android:text="Left Btm"
        android:textSize="25dp"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_gravity="left|bottom"/>
<TextView
        android:text="Center Btm"
        android:textSize="25dp"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_gravity="center|bottom"/>
<TextView
        android:text="Right Btm"
        android:textSize="25dp"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_gravity="right|bottom" />
</FrameLayout>



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.