Write a program to place Name, Age and mobile number centrally on the display screen using Absolute layout
*Program*
<?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="match_parent"
android:layout_height="match_parent"
tools: context=".MainActivity"
android:orientation="vertical">
<TextView
android: id="@+id/t1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="NAME :"
android:textSize="25sp"
android:textStyle="bold"
android:layout_x="20dp"
android:layout_y="20dp"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Enter your Name"
android:layout_x="110dp"
android:layout_y="16dp"/>
<TextView
android: id="@+id/t2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AGE :"
android:textSize="25sp"
android:textStyle="bold"
android:layout_y="60dp"
android:layout_x="20dp” />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Enter your Age"
android:layout_x="110dp"
android:layout_y="57dp"/>
<TextView
android: id="@+id/t3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="MOBILE NO. :"
android:textSize="25sp"
android:textStyle="bold"
android:layout_x="20dp"
android:layout_y="100dp"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Enter your Mobile No."
android:layout_x="180dp"
android:layout_y="95dp"/>
</AbsoluteLayout>
OUTPUT:
Comments
Post a Comment