Best code examples for GridView setVerticalSpacing method (android.widget.GridView.setVerticalSpacing)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for GridView setVerticalSpacing method.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

GridView setVerticalSpacing examples from Open Source projects
This code example shows how to use the following methods: setAdapter, setColumnWidth, setHorizontalSpacing, setStretchMode, setVerticalSpacing
21:	gridView.setHorizontalSpacing(0); 
-
25:	gridView.setColumnWidth(screenWidth / 3 - margin * 2 / 3); 
26:	gridView.setStretchMode(GridView.NO_STRETCH); 
27:	gridView.setHorizontalSpacing(margin / 2); 
28:	gridView.setVerticalSpacing(margin / 2); 
-
30:	gridView.setAdapter(adapter); 
31:	gridView.setRecyclerListener(adapter); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setColumnWidth, setHorizontalSpacing, setNumColumns, setVerticalSpacing, getLayoutParams
125:	RelativeLayout.LayoutParams param = (RelativeLayout.LayoutParams)view.getLayoutParams(); 
-
130:	view.setNumColumns(numColumns); 
131:	view.setColumnWidth(mIconSize); 
132:	view.setHorizontalSpacing(mIconSpacing); 
133:	view.setVerticalSpacing(mIconSpacing); 
134:	view.setLayoutParams(param); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setColumnWidth, setGravity, setNumColumns, setVerticalSpacing, setOverScrollMode
19:	gv.setColumnWidth(200); 
20:	gv.setGravity(Gravity.CENTER); 
21:	gv.setOverScrollMode(View.OVER_SCROLL_ALWAYS); 
22:	gv.setNumColumns(GridView.AUTO_FIT); 
23:	gv.setVerticalSpacing(15); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setGravity, setHorizontalSpacing, setNumColumns, setStretchMode, setVerticalSpacing
74:	mGridView = new GridView(mContext); 
75:	mGridView.setNumColumns(4); 
76:	mGridView.setHorizontalSpacing(10); 
77:	mGridView.setVerticalSpacing(10); 
78:	mGridView.setStretchMode(GridView.STRETCH_COLUMN_WIDTH); 
79:	mGridView.setGravity(Gravity.CENTER); 
80:	mGridView.setOnItemClickListener(this); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAdapter, setColumnWidth, setHorizontalSpacing, setNumColumns, setStretchMode
40:	GridView gridview = new GridView(this); 
41:	gridview.setNumColumns(GridView.AUTO_FIT); 
42:	gridview.setHorizontalSpacing(40); 
43:	gridview.setVerticalSpacing(40); 
44:	gridview.setPadding(20, 20, 20, 0); 
45:	gridview.setFastScrollEnabled(true); 
46:	gridview.setColumnWidth(iconSize); 
47:	gridview.setStretchMode(GridView.STRETCH_COLUMN_WIDTH); 
-
49:	gridview.setAdapter(new ImageAdapter(this, pkgName)); 
50:	gridview.setOnItemClickListener(new AdapterView.OnItemClickListener() { 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setAdapter, setHorizontalSpacing, setNumColumns, setVerticalSpacing, setOnItemClickListener
132:	mGridView = new GridView(this); 
-
134:	mGridView.setAdapter(localMainMenuAdapter); 
135:	mGridView.setNumColumns(COLUMN_SUM); // 设置3列。 
136:	mGridView.setHorizontalSpacing(1);// 横向间隔 
137:	mGridView.setVerticalSpacing(24);// 纵向间隔 
138:	mGridView.setPadding(6, 4, 6, 0);// 设置填充 
139:	mGridView.setOnItemClickListener(this); 
-
141:	this.mScrollLayout.addView(mGridView, mLayoutParams_wrap); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setAdapter, setHorizontalSpacing, setNumColumns, setVerticalSpacing, setOnItemClickListener
152:	mGridView = new GridView(this); 
-
154:	mGridView.setAdapter(localMainMenuAdapter); 
155:	mGridView.setNumColumns(COLUMN_SUM); // 设置3列。 
156:	mGridView.setHorizontalSpacing(1);// 横向间隔 
157:	mGridView.setVerticalSpacing(24);// 纵向间隔 
158:	mGridView.setPadding(6, 4, 6, 0);// 设置填充 
159:	mGridView.setOnItemClickListener(this); 
-
161:	this.mScrollLayout.addView(mGridView, mLayoutParams_wrap); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setAdapter, setHorizontalSpacing, setNumColumns, setVerticalSpacing, setOnItemClickListener
155:	mGridView = new GridView(this); 
-
157:	mGridView.setAdapter(localMainMenuAdapter); 
158:	mGridView.setNumColumns(COLUMN_SUM); // 设置3列。 
159:	mGridView.setHorizontalSpacing(1);// 横向间隔 
160:	mGridView.setVerticalSpacing(24);// 纵向间隔 
161:	mGridView.setPadding(6, 4, 6, 0);// 设置填充 
162:	mGridView.setOnItemClickListener(this); 
-
164:	this.mScrollLayout.addView(mGridView, mLayoutParams_wrap); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setGravity, setHorizontalSpacing, setNumColumns, setStretchMode, setVerticalSpacing
81:	gvTitle = new GridView(activity); 
82:	gvTitle.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, 
-
84:	gvTitle.setNumColumns(4); 
85:	gvTitle.setStretchMode(GridView.STRETCH_COLUMN_WIDTH); 
86:	gvTitle.setVerticalSpacing(15); 
87:	gvTitle.setHorizontalSpacing(10); 
88:	gvTitle.setPadding(10, 10, 10, 10); 
89:	gvTitle.setGravity(Gravity.CENTER); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setAdapter, setHorizontalSpacing, setNumColumns, setVerticalSpacing, setOnItemClickListener
169:	mGridView = new GridView(this); 
-
171:	mGridView.setAdapter(localMainMenuAdapter); 
172:	mGridView.setNumColumns(COLUMN_SUM); // 设置3列。 
173:	mGridView.setHorizontalSpacing(1);// 横向间隔 
174:	mGridView.setVerticalSpacing(24);// 纵向间隔 
175:	mGridView.setPadding(6, 4, 6, 0);// 设置填充 
176:	mGridView.setOnItemClickListener(this); 
-
178:	this.mScrollLayout.addView(mGridView, mLayoutParams_wrap); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setAdapter, setHorizontalSpacing, setNumColumns, setVerticalSpacing, setOnItemClickListener
169:	mGridView = new GridView(this); 
-
171:	mGridView.setAdapter(localMainMenuAdapter); 
172:	mGridView.setNumColumns(COLUMN_SUM); // 设置3列。 
173:	mGridView.setHorizontalSpacing(1);// 横向间隔 
174:	mGridView.setVerticalSpacing(24);// 纵向间隔 
175:	mGridView.setPadding(6, 4, 6, 0);// 设置填充 
176:	mGridView.setOnItemClickListener(this); 
-
178:	this.mScrollLayout.addView(mGridView, mLayoutParams_wrap); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setAdapter, setHorizontalSpacing, setVerticalSpacing, setId, setLayoutParams
297:	title_gView.setLayoutParams(params); 
298:	title_gView.setVerticalSpacing(0);// 垂直间隔 
299:	title_gView.setHorizontalSpacing(0);// 水平间隔 
-
301:	title_gView.setAdapter(titleAdapter);// 设置菜单Adapter 
302:	title_gView.setId(caltitleLayoutID); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setAdapter, setHorizontalSpacing, setNumColumns, setVerticalSpacing, setOnItemClickListener
133:	mGridView = new GridView(this); 
-
136:	mGridView.setAdapter(localMainMenuAdapter); 
137:	mGridView.setNumColumns(COLUMN_SUM); // 设置3列。 
138:	mGridView.setHorizontalSpacing(1);// 横向间隔 
139:	mGridView.setVerticalSpacing(24);// 纵向间隔 
140:	mGridView.setPadding(6, 4, 6, 0);// 设置填充 
141:	mGridView.setOnItemClickListener(this); 
-
143:	this.mScrollLayout.addView(mGridView,mLayoutParams_wrap); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setAdapter, setHorizontalSpacing, setNumColumns, setVerticalSpacing, setOnItemClickListener
154:	mGridView = new GridView(this); 
-
156:	mGridView.setAdapter(localMainMenuAdapter); 
157:	mGridView.setNumColumns(COLUMN_SUM); // 设置3列。 
158:	mGridView.setHorizontalSpacing(1);// 横向间隔 
159:	mGridView.setVerticalSpacing(24);// 纵向间隔 
160:	mGridView.setPadding(6, 4, 6, 0);// 设置填充 
161:	mGridView.setOnItemClickListener(this); 
-
163:	this.mScrollLayout.addView(mGridView, mLayoutParams_wrap); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setAdapter, setHorizontalSpacing, setNumColumns, setVerticalSpacing, setOnItemClickListener
154:	mGridView = new GridView(this); 
-
156:	mGridView.setAdapter(localMainMenuAdapter); 
157:	mGridView.setNumColumns(COLUMN_SUM); // 设置3列。 
158:	mGridView.setHorizontalSpacing(1);// 横向间隔 
159:	mGridView.setVerticalSpacing(24);// 纵向间隔 
160:	mGridView.setPadding(6, 4, 6, 0);// 设置填充 
161:	mGridView.setOnItemClickListener(this); 
-
163:	this.mScrollLayout.addView(mGridView, mLayoutParams_wrap); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setHorizontalSpacing, setNumColumns, setVerticalSpacing
49:	gvMain.setNumColumns(2); 
-
51:	gvMain.setVerticalSpacing(5); 
52:	gvMain.setHorizontalSpacing(5); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setGravity, setHorizontalSpacing, setNumColumns, setStretchMode, setVerticalSpacing
34:	gridView = new GridView(context); 
35:	gridView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, 
-
37:	gridView.setSelector(new ColorDrawable(Color.TRANSPARENT));// 选中的时候为透明色 
38:	gridView.setNumColumns(bodyAdapter.resID.length); 
39:	gridView.setStretchMode(GridView.STRETCH_COLUMN_WIDTH); 
40:	gridView.setVerticalSpacing(0); 
41:	gridView.setHorizontalSpacing(0); 
42:	gridView.setPadding(0, 0, 0, 0); 
43:	gridView.setGravity(Gravity.CENTER); 
44:	gridView.setOnItemClickListener(bodyClick); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: setAdapter, setColumnWidth, setHorizontalSpacing, setNumColumns, setStretchMode
40:	GridView gridview = new GridView(this); 
41:	gridview.setNumColumns(GridView.AUTO_FIT); 
42:	gridview.setHorizontalSpacing(40); 
43:	gridview.setVerticalSpacing(40); 
44:	gridview.setPadding(20, 20, 20, 0); 
45:	gridview.setFastScrollEnabled(true); 
46:	gridview.setColumnWidth(iconSize); 
47:	gridview.setStretchMode(GridView.STRETCH_COLUMN_WIDTH); 
-
49:	gridview.setAdapter(new ImageAdapter(this, pkgName)); 
50:	gridview.setOnItemClickListener(new AdapterView.OnItemClickListener() { 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setColumnWidth, setGravity, setHorizontalSpacing, setNumColumns, setVerticalSpacing
80:	ph.adapter.resetDataForReuse(ph.gridView, provider, pageIndex); 
-
143:	GridView g = new GridView(context); 
-
146:	g.setLayoutParams(lp); 
-
152:	g.setColumnWidth(getColumnWidth()); 
153:	g.setNumColumns(mColumns); 
154:	g.setGravity(Gravity.CENTER); 
155:	g.setVerticalSpacing(mVerticleSpace); 
156:	g.setHorizontalSpacing(mHorizontalSpace); 
-
169:	g.setPadding(left, top, right, bottom); 
-
172:	g.setSelector(android.R.color.transparent); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: setAdapter, setColumnWidth, setHorizontalSpacing, setNumColumns, setStretchMode
40:	GridView gridview = new GridView(this); 
41:	gridview.setNumColumns(GridView.AUTO_FIT); 
42:	gridview.setHorizontalSpacing(40); 
43:	gridview.setVerticalSpacing(40); 
44:	gridview.setPadding(20, 20, 20, 0); 
45:	gridview.setFastScrollEnabled(true); 
46:	gridview.setColumnWidth(iconSize); 
47:	gridview.setStretchMode(GridView.STRETCH_COLUMN_WIDTH); 
-
49:	gridview.setAdapter(new ImageAdapter(this, pkgName)); 
50:	gridview.setOnItemClickListener(new AdapterView.OnItemClickListener() { 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setAdapter, setColumnWidth, setHorizontalSpacing, setNumColumns, setStretchMode
40:	GridView gridview = new GridView(this); 
41:	gridview.setNumColumns(GridView.AUTO_FIT); 
42:	gridview.setHorizontalSpacing(40); 
43:	gridview.setVerticalSpacing(40); 
44:	gridview.setPadding(20, 20, 20, 0); 
45:	gridview.setFastScrollEnabled(true); 
46:	gridview.setColumnWidth(iconSize); 
47:	gridview.setStretchMode(GridView.STRETCH_COLUMN_WIDTH); 
-
49:	gridview.setAdapter(new ImageAdapter(this, pkgName)); 
50:	gridview.setOnItemClickListener(new AdapterView.OnItemClickListener() { 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setGravity, setHorizontalSpacing, setNumColumns, setStretchMode, setVerticalSpacing
27:	gridView = new GridView(context); 
28:	gridView.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, 
-
30:	gridView.setSelector(new ColorDrawable(Color.TRANSPARENT));// 选中的时候为透明色 
31:	gridView.setNumColumns(4); 
32:	gridView.setStretchMode(GridView.STRETCH_COLUMN_WIDTH); 
33:	gridView.setVerticalSpacing(0); 
34:	gridView.setHorizontalSpacing(0); 
35:	gridView.setPadding(0, 0, 0, 0); 
36:	gridView.setGravity(Gravity.CENTER); 
37:	gridView.setOnItemClickListener(bodyClick); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: setAdapter, setGravity, setHorizontalSpacing, setNumColumns, setStretchMode
31:	gvTitle = new GridView(context); 
32:	gvTitle.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, 
-
34:	gvTitle.setNumColumns(titleAdapter.getCount()); 
35:	gvTitle.setStretchMode(GridView.STRETCH_COLUMN_WIDTH); 
36:	gvTitle.setVerticalSpacing(1); 
37:	gvTitle.setHorizontalSpacing(1); 
38:	gvTitle.setGravity(Gravity.CENTER); 
39:	gvTitle.setOnItemClickListener(titleClick); 
40:	gvTitle.setAdapter(titleAdapter); 
41:	gvTitle.setSelector(new ColorDrawable(Color.TRANSPARENT));// Ñ¡ÖеÄʱºòΪ͸Ã÷É« 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: setColumnWidth, setHorizontalSpacing, setNumColumns, setStretchMode, setVerticalSpacing
124:	GridView lv = new GridView(getActivity()); 
125:	lv.setId(android.R.id.list); 
126:	lv.setDrawSelectorOnTop(false); 
127:	lv.setColumnWidth(convertDpToPixels(60, getActivity())); 
128:	lv.setStretchMode(GridView.STRETCH_COLUMN_WIDTH); 
129:	lv.setNumColumns(GridView.AUTO_FIT); 
130:	lv.setHorizontalSpacing(convertDpToPixels(20, getActivity())); 
131:	lv.setVerticalSpacing(convertDpToPixels(20, getActivity())); 
132:	lv.setSmoothScrollbarEnabled(true); 
-
136:	lv.setOverScrollMode(ListView.OVER_SCROLL_NEVER); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: setAdapter, setGravity, setHorizontalSpacing, setNumColumns, setStretchMode
30:	title = new GridView(context); 
31:	title.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); 
32:	title.setNumColumns(titleAdapter.getCount()); 
33:	title.setStretchMode(GridView.STRETCH_COLUMN_WIDTH); 
34:	title.setVerticalSpacing(1); 
35:	title.setHorizontalSpacing(1); 
36:	title.setGravity(Gravity.CENTER); 
37:	title.setOnItemClickListener(titleClick); 
38:	title.setAdapter(titleAdapter); 
39:	title.setSelector(new ColorDrawable(Color.TRANSPARENT));//选中的时候为透明色 
Full Snippet Info
4
CodeRank
Related GridView setVerticalSpacing Questions & Answers:
Other GridView setVerticalSpacing Examples
56:					(int) padding);
57:			gridView.setHorizontalSpacing((int) padding);
58:			gridView.setVerticalSpacing((int) padding);
59:		}
60:

Read More

A view that shows items in two-dimensional scrolling grid. The items in the grid come from the ListAd...
setVerticalSpacing Method Overview
Set the amount of vertical (y) spacing to place between each item in the grid.
See Also
  • getAdapter
    Returns the adapter currently associated with this widget.
  • setHorizontalSpacing
    Set the amount of horizontal (x) spacing to place between each item in the grid.