Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_root_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true">
<View
android:id="@+id/red_box"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="8dp"
android:background="#f00"
android:elevation="4dp"/>
<View
android:id="@+id/green_box"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="8dp"
android:layout_toEndOf="@id/red_box"
android:background="#0f0"
android:elevation="4dp"/>
<View
android:id="@+id/blue_box"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_below="@id/red_box"
android:layout_margin="8dp"
android:background="#00f"
android:elevation="4dp"/>
<View
android:id="@+id/black_box"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_below="@id/green_box"
android:layout_margin="8dp"
android:layout_toEndOf="@id/blue_box"
android:background="#000"
android:elevation="4dp"/>
</RelativeLayout>
</RelativeLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment