I have a cardview in a recyclerview and the problem I am facing is that on populating the recyclerview unneccessary padding appears on top and bottom of imageview inside the cardview.The code of the recyclerview row is given below.please help me
I have tried a lot of codes on stack but no use
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:card_view="http://schemas.android.com/tools"
android:layout_margin="5dp"
card_view:cardCornerRadius="5dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/productsearch_img"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/productsearch"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Proin Volutpat Purus."
android:textSize="11sp"
android:scaleY="1.2"
android:layout_weight="2"
android:layout_gravity="center"
android:textColor="@android:color/black"
android:textStyle="bold"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="$"
android:layout_gravity="center"
android:textSize="20sp"
android:textStyle="bold"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp"
android:textColor="@color/textcolorpink"/>
<TextView
android:id="@+id/prodprice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="5dp"
android:layout_marginRight="10dp"
android:text="25"
android:textColor="@color/textcolorpink"
android:textSize="20sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>