0% found this document useful (0 votes)
41 views

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
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

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
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
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