I am using following code to show the GirdView items.
<GridView
android:id="@+id/gridView"
android:gravity="center_horizontal"
android:layout_below="@+id/searchLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:horizontalSpacing="10dp"
android:numColumns="3"
android:stretchMode="columnWidth"
android:verticalSpacing="10dp" />
Each GridItem (ImageView) is of size 92dp
What i want is to show only 3 Columns or 3 images each Row and each Top, bottom ,left right all needs to be perfectly aligned and equal.
Below is the result of above code.

It can be seen that spaces on left and right of the grid are very less as compared with the ones in between images and also between rows are very small.
Secondly, I am using 92dp. above is the result of S3, but when i use small screen the 3rd image doesn't get fit like in 320 dp screen.
Shouldn't using "dp" automatically adjust according to screen size?
I think this code will help you try it :-
GridView
android:id="@+id/grid_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:numColumns="3"
android:gravity="center"
android:stretchMode="columnWidth"
android:background="#000000"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With