android中GridView关于间距的属性值介绍

时间:2021-05-15 03:53:10

android:columnWidth  
设置列的宽度。关联的方法为:setColumnWidth(int)  
stretchMode属性值的作用是设置GridView中的条目以什么缩放模式去填充空间。参数stretchMode 可选值:NO_STRETCH,STRETCH_SPACING,STRETCH_SPACING_UNIFORM,或STRETCH_COLUMN_WIDTH

android:gravity  
设置此组件中的内容在组件中的位置。可选的值有:top、bottom、left、right、center_vertical、fill_vertical、center_horizontal、fill_horizontal、center、fill、clip_vertical 可以多选,用“|”分开。关联方法:setGravity (int gravity)

android:horizontalSpacing  
两列之间的间距。关联方法:setHorizontalSpacing(int)

android:numColumns  
列数。关联方法:setNumColumns(int)

android:stretchMode  
缩放模式。关联方法:setStretchMode(int)

android:verticalSpacing  
两行之间的间距。关联方法:setVerticalSpacing(int)