You are on page 1of 3

Absolute Layout

Code:-
<?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:layout_width="fill_parent"
android:layout_height="fill_parent"
tools:context=".MainActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="37dp"
android:layout_x="8px"
android:layout_y="30dp"
android:text="User Name"
android:textSize="20sp"
android:textColor="#3F51B5"/>

<EditText
android:layout_width="256dp"
android:layout_height="34dp"
android:layout_x="122dp"
android:layout_y="30dp"
android:width="80px"
android:textColor="#3F51B5"
android:textStyle="bold" />

<TextView
android:layout_width="wrap_content"
android:layout_height="38dp"
android:layout_x="10dp"
android:layout_y="76dp"
android:text="password"
android:textSize="20sp" />

<EditText
android:layout_width="244dp"
android:layout_height="32dp"
android:layout_x="126dp"
android:layout_y="81dp"
android:width="100px" />

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="113dp"
android:layout_y="175dp"
android:text="Log In" />
</AbsoluteLayout>
Output :-

You might also like