android GridView android:stretchMode="columnWidth"

stretchMode属性值的作用是设置GridView中的条目以什么缩放模式去填充空间。参数stretchMode 可选值:NO_STRETCH,STRETCH_SPACING,STRETCH_SPACING_UNIFORM,或STRETCH_COLUMN_WIDTH


<GridView
        android:id="@+id/newsfeedpublish_emoticons"
        android:layout_width="fill_parent"
        android:layout_height="200dip"
        android:background="@drawable/v5_0_1_publisher_emotion_area_bg"
        android:cacheColorHint="#00000000"
        android:focusableInTouchMode="true"
        android:horizontalSpacing="5dip"	//两列之间的间距为5dp
        android:verticalSpacing="5dip"		//两行之间的间距为5dp
        android:listSelector="#00000000"
        android:numColumns="8"				//九宫格一行显示8个
        android:stretchMode="columnWidth"	//缩放与列宽大小同步
        android:visibility="gone" >
    </GridView>



你可能感兴趣的:(android,android,android,GridView,GridView,GridView,stretchMode)