Tuesday, 27 June 2017

Linear Layout To Relative Layout To Form List Using A Image View And Text View

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ImageView
        android:id="@+id/beach_Image_View"
        android:layout_width="56dp"
        android:layout_height="56dp"
        android:scaleType="centerCrop"
        android:src="@drawable/ocean" />

    <TextView
        android:id="@+id/pebble_text_View"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/beach_Image_View"
        android:text="Pebble Beach"
        android:textAppearance="?android:textAppearanceMedium" />

    <TextView
        android:id="@+id/California_Text_View"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/beach_Image_View"
        android:layout_below="@id/pebble_text_View"
        android:text="California"
        android:textAppearance="?android:textAppearanceSmall" />

    <TextView
        android:id="@+id/ten_Text_View"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/beach_Image_View"
        android:layout_below="@id/California_Text_View"
        android:text="10 miles away"
        android:textAppearance="?android:textAppearanceSmall" />

</RelativeLayout>


No comments:

Post a Comment