Skip to content

Instantly share code, notes, and snippets.

@pnalvarez
Created October 16, 2023 12:20
Show Gist options
  • Save pnalvarez/f4e40fab2e189ead4bf1c8a547c67983 to your computer and use it in GitHub Desktop.
Save pnalvarez/f4e40fab2e189ead4bf1c8a547c67983 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">
<TextView
android:id="@+id/v1"
android:layout_width="300dp"
android:layout_height="100dp"
android:background="@color/blue"
>
</TextView>
<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/orange"
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