Skip to content

Instantly share code, notes, and snippets.

@arod2634
Created March 1, 2015 23:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arod2634/50d302ee124caf95f26b to your computer and use it in GitHub Desktop.
Save arod2634/50d302ee124caf95f26b to your computer and use it in GitHub Desktop.
Android Relative Layout Vertical Example
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1">
<TextView
android:layout_width="match_parent"
android:layout_height="150dp"
android:text="One"
android:id="@+id/textView"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:layout_width="match_parent"
android:layout_height="150dp"
android:text="Two"
android:id="@+id/textView2"
android:layout_below="@+id/textView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="false" />
<TextView
android:layout_width="match_parent"
android:layout_height="150dp"
android:text="Three"
android:id="@+id/textView3"
android:layout_below="@+id/textView2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:layout_width="match_parent"
android:layout_height="150dp"
android:text="Four"
android:id="@+id/textView4"
android:layout_below="@+id/textView3"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment