0% found this document useful (0 votes)
15 views2 pages

Practical_7mad

This document contains an XML layout for an Android application featuring a RelativeLayout. It includes a TextView for the title 'Login', two EditText fields for username and password input, and a Button for submission. The layout is designed with specific attributes for positioning and styling elements.

Uploaded by

labadeshravani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views2 pages

Practical_7mad

This document contains an XML layout for an Android application featuring a RelativeLayout. It includes a TextView for the title 'Login', two EditText fields for username and password input, and a Button for submission. The layout is designed with specific attributes for positioning and styling elements.

Uploaded by

labadeshravani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

// Program to implement TextView & EditText

<?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:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent" tools:context=".MainActivity"
android:orientation="vertical"
android:padding="20dp">

<TextView android:id="@+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Login"
android:layout_centerHorizontal="true"
android:textSize="40dp"
android:textStyle="bold"
android:layout_marginTop="30dp"
android:textColor="#5E00FF"/>

<EditText
android:id="@+id/et1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Username"
android:gravity="center"
android:inputType="text"
android:layout_below="@+id/tv1"
android:padding="20dp"
android:textSize="20dp"/>+

<EditText
android:id="@+id/et2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password" android:gravity="center"
android:inputType="text"
android:layout_below="@+id/et1"
android:padding="20dp"
android:textSize="20dp"/>

<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Login"
android:textSize="20dp"
android:textStyle="bold"
android:layout_below="@+id/et2"
android:layout_marginTop="30dp"/>
</RelativeLayout>

Output:

You might also like