Q:

Android - Grid layout overlapping some of the text

So i am creating this app which will display products in a grid, so for example on a nexus 7 portrait view, it will be 2 in each row, while in landscape mode, there will be 4 in a row.
Each product has a imagine, and then a few textviews below it displaying a few information.
However the last two textviews, which display free delivery and number of special offers, seems to be overlapped by the next image below. Could anyone please help me pin point where im going wrong. The layout is below:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="center_horizontal"
    android:orientation="vertical" >

    <RelativeLayout
        android:layout_width="200dp"
        android:layout_height="200dp"
        android:background="@drawable/product_grid_lister_image_background"
        android:padding="1dp" >

        <ProgressBar
            android:id="@+id/image_loading"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:indeterminateDrawable="@drawable/progress_blue" />

        <ImageView
            android:id="@+id/product_grid_lister_image"
            android:layout_width="200dp"
            android:layout_height="200dp"
            android:layout_margin="10dp"
            android:scaleType="center"/>

    </RelativeLayout>

    <RatingBar
        android:id="@+id/product_grid_lister_rating_bar"
        style="@style/GoldRatingBar.Large"
        android:layout_width="wrap_content"
        android:layout_height="18dp"
        android:layout_marginTop="5dp"
        android:numStars="5" />

    <TextView
        android:id="@+id/product_grid_lister_product_name_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ellipsize="end"
        android:lines="2"
        android:includeFontPadding="false"
        android:textColor="@color/black"
        android:textSize="@dimen/text_dp_14pt" />

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <TextView
            android:id="@+id/product_grid_lister_price_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:includeFontPadding="false"
            android:textColor="@color/black"
            android:textSize="@dimen/text_dp_20pt" />

        <TextView
            android:id="@+id/product_grid_lister_was_price_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/product_grid_lister_price_text"
            android:includeFontPadding="false"
            android:textColor="@color/grey"
            android:textSize="@dimen/text_dp_14pt" />

        <TextView
            android:id="@+id/product_grid_lister_offer_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/product_grid_lister_was_price_text"
            android:includeFontPadding="false"
            android:textColor="@color/red"
            android:textSize="@dimen/text_dp_14pt" />

        <TextView
            android:id="@+id/product_grid_lister_special_offer_text"
            style="@style/plp_special_offer"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/product_grid_lister_offer_text"
            android:includeFontPadding="false"
            android:text="@string/plp_special_offer" />

        <TextView
            android:id="@+id/product_grid_lister_delivery_offer_text"
            style="@style/plp_special_offer"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/product_grid_lister_special_offer_text"
            android:includeFontPadding="false"
            android:text="@string/plp_delivery_offer" />

        <CheckBox
            android:id="@+id/product_grid_lister_star_checkbox"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:paddingTop="6dp"
            android:paddingBottom="6dp"
            android:paddingLeft="6dp"
            android:button="@drawable/product_grid_star_checkbox"
            android:focusable="false" />
    </RelativeLayout>

</LinearLayout>

A:

You're missing a namespace declaration as well as a root layout. You need a root layout to anchor everything else in. Depending on your needs, perhaps a LinearLayout would do the trick. Below I've wrapped everything in a vertically oriented linear layout. Let me know if that solves anything for you.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <RelativeLayout
        android:layout_width="200dp"
        android:layout_height="200dp"
        android:background="@drawable/product_grid_lister_image_background"
        android:padding="1dp" >

        <ProgressBar
            android:id="@+id/image_loading"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:indeterminateDrawable="@drawable/progress_blue" />

        <ImageView
            android:id="@+id/product_grid_lister_image"
            android:layout_width="200dp"
            android:layout_height="200dp"
            android:layout_margin="10dp"
            android:scaleType="center" />
    </RelativeLayout>

    <RatingBar
        android:id="@+id/product_grid_lister_rating_bar"
        style="@style/GoldRatingBar.Large"
        android:layout_width="wrap_content"
        android:layout_height="18dp"
        android:layout_marginTop="5dp"
        android:numStars="5" />

    <TextView
        android:id="@+id/product_grid_lister_product_name_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ellipsize="end"
        android:includeFontPadding="false"
        android:lines="2"
        android:textColor="@color/black"
        android:textSize="@dimen/text_dp_14pt" />

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <TextView
            android:id="@+id/product_grid_lister_price_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:includeFontPadding="false"
            android:textColor="@color/black"
            android:textSize="@dimen/text_dp_20pt" />

        <TextView
            android:id="@+id/product_grid_lister_was_price_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/product_grid_lister_price_text"
            android:includeFontPadding="false"
            android:textColor="@color/grey"
            android:textSize="@dimen/text_dp_14pt" />

        <TextView
            android:id="@+id/product_grid_lister_offer_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/product_grid_lister_was_price_text"
            android:includeFontPadding="false"
            android:textColor="@color/red"
            android:textSize="@dimen/text_dp_14pt" />

        <TextView
            android:id="@+id/product_grid_lister_special_offer_text"
            style="@style/plp_special_offer"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/product_grid_lister_offer_text"
            android:includeFontPadding="false"
            android:text="@string/plp_special_offer" />

        <TextView
            android:id="@+id/product_grid_lister_delivery_offer_text"
            style="@style/plp_special_offer"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/product_grid_lister_special_offer_text"
            android:includeFontPadding="false"
            android:text="@string/plp_delivery_offer" />

        <CheckBox
            android:id="@+id/product_grid_lister_star_checkbox"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:button="@drawable/product_grid_star_checkbox"
            android:focusable="false"
            android:paddingBottom="6dp"
            android:paddingLeft="6dp"
            android:paddingTop="6dp" />
    </RelativeLayout>

</LinearLayout>

