Comment faire pour forcer le GridView pour générer des cellules carrées dans Android

Comment puis-je forcer android GridView pour générer des cellules carrées (de la Cellule à la hauteur égale à la cellule de largeur)
GridView a 10*9 cellules et l'application doit prendre en charge plusieurs écrans !

J'ai utilisé un Linéaire de la Mise en page:

row_grid.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:padding="0dp" >

        <ImageView
            android:id="@+id/item_image"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scaleType="fitXY"
            android:src="@drawable/ic_launcher" >
        </ImageView>

    </LinearLayout>

et GridView:
activity_main.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/katy" >

    <GridView
        android:id="@+id/gridView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:horizontalSpacing="0dp"
        android:numColumns="4"
        android:stretchMode="columnWidth"
        android:verticalSpacing="0dp" >
    </GridView>
</RelativeLayout>

Chaque cellule de la GridView contient une image qui a la même largeur et la hauteur.
les images sont plus grandes que les cellules et doit s'étirer pour s'adapter dans les cellules.
Comment faire pour forcer le GridView pour générer des cellules carrées dans Android

InformationsquelleAutor Jessica | 2014-06-25