Comment puis-je centre un GridView dans son LinearLayout parent?

GridView ne se comporte pas comme il est censé le faire.
Cette capture d'écran montre que le contrôle GridView (en mode paysage) est vidé de gauche.
Je veux qu'il soit centré.

C'est le XML de mise en page pour le contrôle GridView.

<LinearLayout 
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/templatelandscape"
  android:orientation="horizontal"
  android:layout_width="fill_parent" 
  android:layout_height="wrap_content">
<GridView 
  android:id="@+id/commandsbarlandscape"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_weight="1.0"
  android:layout_alignParentTop="true"
  android:layout_centerInParent="true"
  android:padding="0dp"
  android:verticalSpacing="2dp"
  android:horizontalSpacing="2dp"
  android:numColumns="auto_fit"
  android:columnWidth="52dp"
  android:stretchMode="spacingWidth"
  android:gravity="fill_horizontal" />
</LinearLayout>

Ce que je fais mal ?

Vous avez besoin GridView pour être centré ou de ses éléments???
Je veux le contrôle GridView pour être centré dans son parent. Pas les éléments.

OriginalL'auteur Jacques René Mesrine | 2009-10-09