0% found this document useful (0 votes)
18 views7 pages

XMLL

The document contains XML layout code for an Android application, featuring multiple buttons arranged in various layouts including LinearLayout and ConstraintLayout. It specifies button properties such as text, width, height, and alignment within the parent layout. The structure allows for a responsive design with buttons organized vertically and horizontally.

Uploaded by

rooginn4
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)
18 views7 pages

XMLL

The document contains XML layout code for an Android application, featuring multiple buttons arranged in various layouts including LinearLayout and ConstraintLayout. It specifies button properties such as text, width, height, and alignment within the parent layout. The structure allows for a responsive design with buttons organized vertically and horizontally.

Uploaded by

rooginn4
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/ 7

<?xml version="1.0" encoding="utf-8"?

>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="10dp">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="BUTTON1" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="BUTTON2"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="end">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="BUTTON3"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="BUTTON4" />
</LinearLayout>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="BUTTON5" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="start">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="BUTTON6" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="BUTTON7" />
</LinearLayout>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="BUTTON8" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="BUTTON9"
android:layout_weight="1"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="BUTTON10"
android:layout_weight="1"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="BUTTON11"
android:layout_weight="1"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="BUTTON12"
android:layout_weight="1"/>
</LinearLayout>

</LinearLayout>

<androidx.constraintlayout.widget.ConstraintLayout
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=".MainActivity2">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="MissingConstraints"
android:layout_marginTop="15dp">
<Button
android:layout_marginTop="15dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_alignParentTop="true"
android:id="@+id/btn1"
android:text="Button1"/>
<Button
android:layout_marginTop="15dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button2"
android:layout_alignParentEnd="true"/>
<Button
android:layout_marginTop="15dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button3"
android:id="@+id/btn3"
android:layout_below="@id/btn1"/>
<Button
android:layout_marginTop="15dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button4"
android:layout_centerInParent="true"
android:layout_below="@id/btn1"/>
<Button
android:layout_marginTop="15dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button5"
android:layout_alignParentEnd="true"
android:layout_below="@id/btn1"/>
<Button
android:layout_marginTop="15dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button6"
android:layout_alignParentLeft="true"
android:layout_below="@id/btn3"
android:id="@+id/btn6"/>
<Button
android:layout_marginTop="15dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button7"
android:layout_alignParentRight="true"
android:layout_below="@id/btn6"
android:id="@+id/btn7"/>
<Button
android:layout_marginTop="15dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button8"
android:layout_alignParentLeft="true"
android:layout_below="@id/btn7"
android:id="@+id/btn8"/>
<Button
android:layout_marginTop="15dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button9"
android:layout_alignParentRight="true"
android:layout_below="@id/btn7"
android:id="@+id/btn9"/>
<Button
android:layout_marginTop="15dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button10"
android:layout_alignParentLeft="true"
android:layout_below="@id/btn8"
android:id="@+id/btn10"/>
<Button
android:layout_marginTop="15dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button11"
android:layout_centerInParent="true"
android:layout_below="@id/btn8"
android:id="@+id/btn11"/>
<Button
android:layout_marginTop="15dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button12"
android:layout_centerInParent="true"
android:layout_below="@id/btn10"
android:id="@+id/btn12"/>
<Button
android:layout_marginTop="15dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button13"
android:layout_alignParentLeft="true"
android:layout_below="@id/btn12"
android:id="@+id/btn13"/>
<Button
android:layout_marginTop="15dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button14"
android:layout_centerInParent="true"
android:layout_below="@id/btn13"
android:id="@+id/btn14"/>

<Button
android:layout_marginTop="15dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button15"
android:layout_alignParentRight="true"
android:layout_below="@id/btn14"
android:id="@+id/btn15"/>
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

You might also like