I a trying to develop the list of card view, In the cardview design height of my image is not getting auto adjusted with respect of the cardview height. Here is my image of view :
And here is my source code for the cardview :
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/cardView"
app:cardUseCompatPadding="true"
app:cardElevation="5dp"
app:cardCornerRadius="4dp"
android:layout_marginBottom="16dp">
<RelativeLayout
android:id="@+id/POIDetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/graylight">
<ImageView
android:id="@+id/POIPic"
android:layout_width="76dp"
android:contentDescription="@string/poiImageCaptureDescription"
android:layout_height="113dp"
android:maxWidth="10dp"
android:src="@drawable/sample" />
<TextView
android:id="@+id/POIName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:layout_marginStart="10dp"
android:textStyle="bold"
android:textSize="15sp"
android:layout_alignTop="@+id/POIPic"
android:layout_toEndOf="@id/POIPic" />
<TextView
android:id="@+id/POICategory"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:textColor="@color/colorPrimary"
android:layout_marginStart="10dp"
android:layout_below="@id/POIName"
android:layout_alignParentEnd="true"
android:layout_toEndOf="@+id/POIPic" />
<TextView
android:id="@+id/POIAddress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableStart="@drawable/ic_location_on_black_14dp"
android:drawablePadding="5dp"
android:layout_marginTop="10dp"
android:textSize="12sp"
android:layout_marginStart="10dp"
android:layout_below="@id/POICategory"
android:layout_alignParentEnd="true"
android:layout_toEndOf="@+id/POIPic" />
<TextView
android:id="@+id/POICreated"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:textSize="12sp"
android:drawableStart="@drawable/ic_event_black_14dp"
android:drawablePadding="5dp"
android:layout_marginStart="10dp"
android:layout_below="@id/POIAddress"
android:layout_alignParentEnd="true"
android:layout_toEndOf="@+id/POIPic" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="22dp"
android:layout_below="@+id/POIPic"
android:paddingBottom="4dp"
android:background="@color/colorPrimary">
<LinearLayout
android:id="@+id/latlong"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="@string/latitudeText"
android:textStyle="bold"
android:layout_marginStart="5dp"
android:textColor="@color/graylight"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".70" />
<TextView
android:id="@+id/lat"
android:textColor="@color/graylight"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".70" />
<TextView
android:text="@string/longitudeText"
android:textStyle="bold"
android:layout_width="0dp"
android:textColor="@color/graylight"
android:layout_height="wrap_content"
android:layout_weight=".70" />
<TextView
android:id="@+id/longti"
android:textColor="@color/graylight"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".70" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
Can you help me to sort out what can be done to solve this problem, Thanks in advance?