Actually I want to make a grid View with limited item such that there should be two items in a row and there should be proper spacing between them .In Grid view ,I have used android:stretchMode="spacingWidthUniform"> but now there is no such option. I need a default function that should work in all situations. i.e one at one corner ,other at differnt corner with some padding and margins.
Here is the code of single grid
<android.support.v7.widget.CardView
android:id="@+id/cardView"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
app:cardCornerRadius="20dp"
app:cardElevation="@dimen/activity_vertical_margin"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/vehicle_selection_single_item_layout"
android:layout_width="100dp"
android:layout_height="150dp"
android:orientation="vertical"
android:layoutMode="clipBounds"
android:padding="5dp">
<ImageView
android:id="@+id/single_item_image_view"
android:src="@drawable/car"
android:layout_width="match_parent"
android:layout_height="100dp" />
<TextView
android:id="@+id/single_item_text_view"
android:layout_width="100dp"
android:layout_height="50dp"
android:text="Car"
android:textSize="15sp"
android:layout_marginStart="2dp"
android:textStyle="bold"
android:textColor="@color/navy_blue"/>
</RelativeLayout>
</android.support.v7.widget.CardView>