0% found this document useful (0 votes)
60 views3 pages

Relativelayout: Relative Layout XML Code Practical No 6

The document contains XML code for a RelativeLayout that displays 5 buttons of different names and sizes in various positions within the layout using relative positioning attributes. The buttons are named "Darshan", "Shantanu", "Alfaz", "Sahil", and "Kishor" and are of varying widths, heights, and positioned relative to each other or the parent layout using attributes like layout_alignParentTop, layout_alignParentBottom, layout_toEndOf, etc.

Uploaded by

Ss1122
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)
60 views3 pages

Relativelayout: Relative Layout XML Code Practical No 6

The document contains XML code for a RelativeLayout that displays 5 buttons of different names and sizes in various positions within the layout using relative positioning attributes. The buttons are named "Darshan", "Shantanu", "Alfaz", "Sahil", and "Kishor" and are of varying widths, heights, and positioned relative to each other or the parent layout using attributes like layout_alignParentTop, layout_alignParentBottom, layout_toEndOf, etc.

Uploaded by

Ss1122
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/ 3

Relative layout xml code

Practical no 6

<?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/button"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<Button
android:id="@+id/b1"
android:layout_width="285dp"
android:layout_height="115dp"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="293dp"
android:layout_marginEnd="61dp"
android:layout_marginRight="78dp"
android:text="Darshan"
android:textSize="30dp" />

<Button
android:id="@+id/b1"
android:layout_width="172dp"
android:layout_height="97dp"
android:layout_alignTop="@+id/b1"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginTop="0dp"
android:layout_marginEnd="9dp"
android:layout_marginRight="9dp"
android:layout_marginBottom="112dp"
android:text="Shantanu"
android:textSize="20dp" />

<Button
android:id="@+id/b1"
android:layout_width="wrap_content"
android:layout_height="106dp"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_marginStart="101dp"
android:layout_marginTop="104dp"
android:layout_marginRight="40dp"
android:layout_marginBottom="9dp"
android:layout_toEndOf="@+id/b1"
android:text="Alfaz"
android:textSize="20dp" />

<Button
android:id="@+id/b1"
android:layout_width="201dp"
android:layout_height="103dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginStart="9dp"
android:layout_marginLeft="25dp"
android:layout_marginTop="83dp"
android:layout_marginEnd="21dp"
android:layout_marginBottom="9dp"
android:text="Sahil"
android:textSize="20dp" />

<Button
android:id="@+id/b1"
android:layout_width="167dp"
android:layout_height="89dp"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="9dp"
android:layout_marginLeft="9dp"
android:layout_marginEnd="21dp"
android:layout_marginBottom="120dp"
android:text="Kishor"
android:textSize="20dp" />
</RelativeLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
Screen shot

You might also like