Skip to content

Instantly share code, notes, and snippets.

@pnalvarez
Created October 16, 2023 12:16
Show Gist options
  • Save pnalvarez/915958b238500618cf672828a63ec8d5 to your computer and use it in GitHub Desktop.
Save pnalvarez/915958b238500618cf672828a63ec8d5 to your computer and use it in GitHub Desktop.
<?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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<View
android:id="@+id/v1"
android:layout_width="300dp"
android:layout_height="100dp"
android:background="@color/blue"
>
</View>
<View
android:id="@+id/v2"
android:layout_width="200dp"
android:layout_height="100dp"
android:background="@color/red"
android:layout_below="@id/v1"
>
</View>
<View
android:id="@+id/v3"
android:layout_width="200dp"
android:layout_height="100dp"
android:background="@color/green"
android:layout_toRightOf="@id/v2"
android:layout_below="@id/v1"
>
</View>
<View
android:id="@+id/v4"
android:layout_width="200dp"
android:layout_height="100dp"
android:background="@color/yellow"
android:layout_alignEnd="@id/v1"
android:foregroundGravity="right"
>
</View>
</RelativeLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment