0% found this document useful (0 votes)
7 views20 pages

Linearlayout

The document contains three XML layout examples for an Android application: LinearLayout, AbsoluteLayout, and GridLayout. Each layout includes TextViews for 'Email' and 'Password', EditTexts for user input, and a Button for login functionality. The layouts differ in structure and positioning of elements, showcasing various ways to design the user interface.

Uploaded by

lochansawant0107
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)
7 views20 pages

Linearlayout

The document contains three XML layout examples for an Android application: LinearLayout, AbsoluteLayout, and GridLayout. Each layout includes TextViews for 'Email' and 'Password', EditTexts for user input, and a Button for login functionality. The layouts differ in structure and positioning of elements, showcasing various ways to design the user interface.

Uploaded by

lochansawant0107
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/ 20

LINEARLAYOUT

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

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Email"
android:textColor="#0C0F5B"
android:textSize="30dp"
android:textStyle="bold"/>

<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Enter your email"
android:textColor="#0C0F5B"
android:textSize="30dp"/>
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Password"
android:textColor="#0C0F5B"
android:textSize="30dp"
android:textStyle="bold" />

<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Enter your password "
android:textColor="#0C0F5B"
android:textSize="20dp"

</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">

</LinearLayout>

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="login" />

</LinearLayout>
Absolutelayout
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout 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">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Email"
android:layout_x="10dp"
android:layout_y="20dp"
/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Enter the password"
android:layout_x="70dp"
android:layout_y="50dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Password"
android:layout_x="10dp"
android:layout_y="60dp"
/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Enter the email"
android:layout_x="60dp"
android:layout_y="10dp"

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="login"
android:layout_x="80dp"
android:layout_y="100dp"
/>
</AbsoluteLayout>
GRIDLAYOUT
<?xml version="1.0" encoding="utf-8"?>
<GridLayout 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:rowCount="3"
android:columnCount="2"
android:background="#0BB1C5"
>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_row="0"
android:layout_column="0"
android:text="Email"
android:background="#00BCD4"
android:textColor="@color/black"
android:textSize="30sp"
android:textStyle="bold"
/>

<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Enter the email"
android:layout_row="0"
android:layout_column="1"
android:background="#00BCD4"
android:textColor="@color/black"
android:textSize="20sp"

/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_row="1"
android:layout_column="0"
android:text="Password"
android:background="#00BCD4"
android:textColor="@color/black"
android:textSize="30sp"
android:textStyle="bold"

/>

<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Enter the password"
android:layout_row="1"
android:layout_column="1"
android:background="#00BCD4"
android:textColor="@color/black"
android:textSize="20sp"

/>

<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_row="2"
android:layout_column="0"
android:text="Login"
android:layout_columnSpan="2"/>
</GridLayout>

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy