Professional Documents
Culture Documents
Practical No - 6,7
Practical No - 6,7
Practical No - 6,7
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="30dp"
android:layout_y="50dp"
android:text="Username : "/>
<EditText
android:layout_width="90sp"
android:layout_height="30dp"
android:layout_x="120dp"
android:layout_y="50dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="30dp"
android:layout_y="90dp"
android:text="Password : "/>
<EditText
android:layout_width="90sp"
android:layout_height="30dp"
android:layout_x="120dp"
android:layout_y="90dp"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Submit"
android:layout_x="70dp"
android:layout_y="120dp"/>
</AbsoluteLayout>
“Login Form Using Linear Layout”
<? xml version="1.0" encoding="utf-8"? >
<FrameLayout 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:background="@drawable/bg">
</FrameLayout>
“Login Form Using TableLayout”
<? xml version="1.0" encoding="utf-8" ?>
<TableLayout 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">
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Username : "
android:padding="5dp"/>
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="5dp"/>
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Password : "
android:padding="5dp"/>
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="5dp"/>
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Submit"
android:padding="5dp"/>
</TableRow>
</TableLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Login"
android:textSize="30sp"
android:textStyle="bold"
android:layout_marginTop="100sp"
android:layout_centerHorizontal="true"
android:textColor="@color/white"
android:id="@+id/sign"
/>
<EditText
android:id="@+id/user"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/sign"
android:layout_marginStart="10sp"
android:layout_marginTop="10sp"
android:layout_marginEnd="10sp"
android:layout_marginBottom="10sp"
android:background="#30FFFFFF"
android:hint="USERNAME"
android:padding="10sp"
android:textColorHint="@color/white">
</EditText>
<EditText
android:id="@+id/pass"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/user"
android:layout_marginStart="10sp"
android:layout_marginTop="10sp"
android:layout_marginEnd="10sp"
android:layout_marginBottom="10sp"
android:background="#30FFFFFF"
android:hint="PASSWORD"
android:padding="10sp"
android:textColorHint="@color/white">
</EditText>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/pass"
android:layout_marginTop="25sp"
android:text="Login"
android:textSize="20sp"/>
</RelativeLayout>