Skip to content

Instantly share code, notes, and snippets.

@Dampas
Last active January 14, 2017 22:27
Show Gist options
  • Select an option

  • Save Dampas/12927a5a276d1c1a082b7de3a2bbf1e5 to your computer and use it in GitHub Desktop.

Select an option

Save Dampas/12927a5a276d1c1a082b7de3a2bbf1e5 to your computer and use it in GitHub Desktop.
Android Basics: User Interface
<?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/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.android.happybirthday.MainActivity">
<ImageView
android:src="@drawable/androidparty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:scaleType="centerCrop"
android:id="@+id/imageView" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Happy Birthday, Ivona!"
android:fontFamily="sans-serif-light"
android:textSize="36sp"
android:textColor="#FFF"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:text="From Damir"
android:fontFamily="sans-serif-light"
android:textSize="36sp"
android:textColor="#FFF"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_vertical_margin"/>
</RelativeLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment