GridView 设置 item 间距的方法
2015-03-03 18:03
513 查看
GridView 提供这么两个方法 setHorizontalSpacing(int) 和 setVerticalSpacing(int)。API的DOC如下:来自Binkery技术博客,http://www.binkery.com/archives/190.html
Open Declaration void android.widget.GridView.setHorizontalSpacing(int horizontalSpacing)来自Binkery技术博客,http://www.binkery.com/archives/190.html
Set the amount of horizontal (x) spacing to place between each item in the grid.来自Binkery技术博客,http://www.binkery.com/archives/190.html
Parameters:
horizontalSpacing The amount of horizontal space between items, in pixels.来自Binkery技术博客,http://www.binkery.com/archives/190.html
@attr
ref android.R.styleable#GridView_horizontalSpacing来自Binkery技术博客,http://www.binkery.com/archives/190.html
Open Declaration void android.widget.GridView.setVerticalSpacing(int verticalSpacing)来自Binkery技术博客,http://www.binkery.com/archives/190.html
Set the amount of vertical (y) spacing to place between each item in the grid.来自Binkery技术博客,http://www.binkery.com/archives/190.html
Parameters:
verticalSpacing The amount of vertical space between items, in pixels.来自Binkery技术博客,http://www.binkery.com/archives/190.html
@attr
ref android.R.styleable#GridView_verticalSpacing来自Binkery技术博客,http://www.binkery.com/archives/190.html
注意:这里设置的是item之间的间隔,space between items.来自Binkery技术博客,http://www.binkery.com/archives/190.html
Open Declaration void android.widget.GridView.setHorizontalSpacing(int horizontalSpacing)来自Binkery技术博客,http://www.binkery.com/archives/190.html
Set the amount of horizontal (x) spacing to place between each item in the grid.来自Binkery技术博客,http://www.binkery.com/archives/190.html
Parameters:
horizontalSpacing The amount of horizontal space between items, in pixels.来自Binkery技术博客,http://www.binkery.com/archives/190.html
@attr
ref android.R.styleable#GridView_horizontalSpacing来自Binkery技术博客,http://www.binkery.com/archives/190.html
Open Declaration void android.widget.GridView.setVerticalSpacing(int verticalSpacing)来自Binkery技术博客,http://www.binkery.com/archives/190.html
Set the amount of vertical (y) spacing to place between each item in the grid.来自Binkery技术博客,http://www.binkery.com/archives/190.html
Parameters:
verticalSpacing The amount of vertical space between items, in pixels.来自Binkery技术博客,http://www.binkery.com/archives/190.html
@attr
ref android.R.styleable#GridView_verticalSpacing来自Binkery技术博客,http://www.binkery.com/archives/190.html
注意:这里设置的是item之间的间隔,space between items.来自Binkery技术博客,http://www.binkery.com/archives/190.html
相关文章推荐
- 固定列数,根据item数量动态设置GridView高度的方法
- GridView的getChildAt(postion)获取不到指定位置的item的解决方法(动态设置指定item为选中状态)
- GridView中设置DataFormatString无效的解决方法.
- GridView中设置DataFormatString无效的解决方法
- android实现界面左右滑动(GridView动态设置item,支持每个item按某个属性排序来显示在不同的界面)
- IOS 设置UIToolbar的UIBarButtonItem的间距
- 设置gridview里面item的高度
- 本方法只需要设置一个GridView的宽度,其它宽度不需要设置。测试环境:IE6,Firefox通过。
- Android ListView的item背景色设置和item点击无响应的解决方法
- win8中ListView、GridView、ListBox如何更改Item的背景色、间距之类等?
- word2003设置编号间距的方法
- yii gridview button的设置方法
- GridView中设置日期格式不起作用的解决方法
- 关于设置HTML行间距的方法与问题
- gridview 设置传递多个参数的方法
- TextView中设置行间距的方法
- 在gridview里对日期字段设置dataformatstring="{0:yyyy-MM-dd}"没有任何作用的解决方法
- 使用Container.ItemIndex获取Repeater、Gridview行的序号的简单方法
- 设置 GridView item 背景透明
- IE10下Gridview后台设置行高不起作用解决方法