Skip to content

Instantly share code, notes, and snippets.

@redtripleAAA
Created January 27, 2018 06:24
Show Gist options
  • Save redtripleAAA/dff5f7376f0ee9b3e70e9bab20c72428 to your computer and use it in GitHub Desktop.
Save redtripleAAA/dff5f7376f0ee9b3e70e9bab20c72428 to your computer and use it in GitHub Desktop.
Quiz 10 - Udacity - List Item with RelativeLayout
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/ocean_image_view"
android:layout_width="56dp"
android:layout_height="56dp"
android:scaleType="centerCrop"
android:src="@drawable/ocean" />
<TextView
android:id="@+id/PebbleBeach_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Pebble Beach"
android:layout_toRightOf="@id/ocean_image_view"
android:textAppearance="?android:textAppearanceMedium" />
<TextView
android:id="@+id/California_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="California"
android:layout_toRightOf="@id/ocean_image_view"
android:layout_below="@id/PebbleBeach_text_view"
android:textAppearance="?android:textAppearanceSmall" />
<TextView
android:id="@+id/TenMilesAway_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="10 miles away"
android:layout_toRightOf="@id/ocean_image_view"
android:layout_below="@id/California_text_view"
android:textAppearance="?android:textAppearanceSmall" />
</RelativeLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment