0% found this document useful (0 votes)
28 views1 page

XML Code Basic Android

This document defines the layout of a sample Android application containing a TextView labeled "Hello World", a Button, and an ImageView. The TextView is centered at the top of the parent layout. The Button and ImageView are placed at absolute positions within the layout for preview purposes.

Uploaded by

Udit Rana
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download as txt, pdf, or txt
0% found this document useful (0 votes)
28 views1 page

XML Code Basic Android

This document defines the layout of a sample Android application containing a TextView labeled "Hello World", a Button, and an ImageView. The TextView is centered at the top of the parent layout. The Button and ImageView are placed at absolute positions within the layout for preview purposes.

Uploaded by

Udit Rana
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1/ 1

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

>
<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=".MainActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
tools:layout_editor_absoluteX="151dp"
tools:layout_editor_absoluteY="255dp" />

<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:layout_editor_absoluteX="128dp"
tools:layout_editor_absoluteY="66dp"
tools:srcCompat="@tools:sample/avatars" />

</androidx.constraintlayout.widget.ConstraintLayout>

You might also like