Center elements in GridView
I have GridView with 6 images in 2 columns. I want to display this 6 images in the middle of the screen. I set gravity properties to center but this center elements only horizontally. GridView takes whole screen.


    <GridView
        android:id="@+id/gridview"
        android:layout_above="@id/ad" android:layout_alignParentTop="true"
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:numColumns="2"    
        android:verticalSpacing="10dp"
        android:horizontalSpacing="10dp"
        android:stretchMode="columnWidth"       
        android:background="#ffffff"
        android:gravity="center"
    />
Center elements in GridView
===

I have GridView with 6 images in 2 columns. I want to display this 6 images in the middle of the screen. I set gravity properties to center but this center elements only horizontally. GridView takes whole screen.


    <GridView
        android:id="@+id/gridview"
        android:layout_above="@id/ad" android:layout_alignParentTop="true"
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:numColumns="2"    
        android:verticalSpacing="10dp"
        android:horizontalSpacing="10dp"
        android:stretchMode="columnWidth"       
        android:background="#ffffff"
        android:gravity="center"
    />