I am trying to create a custom gridview item which looks something like how the movies are shown in this image:
in the sense, that how they have an image at the top and two or three text views below it. I have used the following XML code for this but i am not getting the required layout.
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="10dp"
android:layout_marginBottom="5dp"
android:background="@drawable/bg_card"
>
<TextView
android:id="@+id/txtTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginBottom="2dp"
android:layout_marginTop="2dp"
android:gravity="center_vertical"
android:padding="2dip"
android:textColor="@color/palletblue"
android:textAppearance="@android:attr/textAppearanceLarge"
android:textSize="22sp"
android:textStyle="bold" />
<TextView
android:id="@+id/txtTitle2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginBottom="2dp"
android:layout_marginTop="2dp"
android:layout_below="@id/txtTitle"
android:gravity="center_vertical"
android:padding="2dip"
android:textAppearance="@android:attr/textAppearanceLarge"
android:textColor="#878787"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:id="@+id/txtTitle3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@id/txtTitle2"
android:layout_marginBottom="2dp"
android:layout_marginTop="2dp"
android:gravity="center_vertical"
android:padding="2dip"
android:textAppearance="@android:attr/textAppearanceLarge"
android:textColor="#878787"
android:textSize="12sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/imgIcon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_above="@id/txtTitle"
android:layout_marginBottom="3dp"
android:gravity="center_vertical"
android:padding="2dip"
/>
</RelativeLayout>
</FrameLayout>
Where am i going wrong here? Thanks