Write a Program to accept Username and Password from the end user using Text View and Edit Text

 



<?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"
    >

    <TextView
        android:text="Login Form"
        android:textSize="35dp"
        android:textStyle="bold"
        android:gravity="center"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        />

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

        <TableRow>

            <TextView
                android:text="Username:"
                android:textSize="27dp"
                android:textStyle="bold"
                android:layout_marginTop="50dp"
                android:layout_marginLeft="20dp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                />

            <EditText
                android:hint="Enter the Username"
                android:textSize="25dp"
                android:layout_marginTop="50dp"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                />

        </TableRow>

        <TableRow>

            <TextView
                android:text="Password:"
                android:textSize="27dp"
                android:textStyle="bold"
                android:layout_marginTop="50dp"
                android:layout_marginLeft="20dp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                />

            <EditText
                android:hint="Enter the Password"
                android:textSize="25dp"
                android:inputType="textPassword"
                android:layout_marginTop="50dp"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                />

        </TableRow>

    </TableLayout>

    <Button
        android:text="Sign In"
        android:textSize="27dp"
        android:textStyle="bold"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="50dp"
        android:layout_gravity="center"
        />

</LinearLayout>

Output:


Comments

Popular posts from this blog

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

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