1 <GridViewAndroid:id= "@+id/grid" 2 Android:layout_width= "Fill_parent" 3 Android:layout_height= "Fill_parent" 4 android:verticalspacing= "35px"<!--vertical spacing between grid elements--> 5Android:horizontalspacing= "5px"<!--horizontal interval between grid elements - 6Android:numcolumns= "Auto_fit"<!--indicates how many columns, if set to Auto_fit, are automatically calculated based on columnwidth and spacing - 7Android:columnwidth= "100px"<!--It is generally recommended to use a dip or DP with a pixel-density-independent representation - 8Android:stretchmode= "ColumnWidth"<!--How to fill the spare position, simulator using wvga800*480, each row of 4 columns, there is 4*100+5*3=415, still more than 65px of space, if it is columnwidth, then the remaining 65 will be allocated to 4 columns, each column increased 16/17px. If Spacingwidth is used, allocate to 3 spacer spaces - 9android:gravity= "Center"/>