Create the below form using Relative Layout.

 



<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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="wrap_content"
    tools:context=".MainActivity >
<Button
        android:id="@+id/b1"
        android:text="Button1"
        android:textStyle="bold"
        android:textSize="25dp"
        android:layout_marginLeft="30dp"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        />
<Button
    android:id="@+id/b2"
    android:text="Button2"
    android:textStyle="bold"
    android:textSize="25dp"
    android:layout_toRightOf="@id/b1"
    android:layout_marginLeft="30dp"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"/>
<Button
        android:id="@+id/b3"
        android:text="Button3"
        android:textStyle="bold"
        android:textSize="25dp"
        android:layout_below="@id/b2"
        android:layout_marginTop="20dp"
        android:layout_marginLeft="30dp"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"/>
<TextView
        android:id="@+id/t1"
        android:text="User Id:"
        android:textStyle="bold"
        android:textSize="25dp"
        android:layout_below="@id/b3"
        android:layout_marginTop="30dp"
        android:layout_marginLeft="30dp"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content" />
<EditText
        android:id="@+id/e1"
        android:hint="Enter the User Id:"
        android:textSize="25dp"
        android:inputType="number"
        android:layout_alignBaseline="@id/t1"
        android:layout_toRightOf="@id/t1"
        android:layout_marginLeft="30dp"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"/>
<Button
        android:id="@+id/b4"
        android:text="Sign In"
        android:textStyle="bold"
        android:textSize="25dp"
        android:layout_below="@id/e1"
        android:layout_marginTop="20dp"
        android:layout_centerInParent="true"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"/>

</RelativeLayout>

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.