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: setRecyclerListener, setAdapter, setColumnWidth, setHorizontalSpacing, setStretchMode
    protected void onCreate(final Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(this.getResources().getIdentifier("test_activity_grid", "layout", "pl.polidea.androidflip3d"));
        final GridView gridView = (GridView) findViewById(this.getResources().getIdentifier("GridView", "id",
                "pl.polidea.androidflip3d")); 
        gridView.setHorizontalSpacing(0);
        final int screenWidth = this.getWindow().getWindowManager().getDefaultDisplay().getWidth();
        final int margin = 10;
        Log.v(TAG, "Screen width = " + screenWidth);
        gridView.setColumnWidth(screenWidth / 3 - margin * 2 / 3);
        gridView.setStretchMode(GridView.NO_STRETCH);
        gridView.setHorizontalSpacing(margin / 2);
        gridView.setVerticalSpacing(margin / 2);
        final TestGridAdapter adapter = new TestGridAdapter(this, screenWidth / 3 - margin);
        gridView.setAdapter(adapter);
        gridView.setRecyclerListener(adapter);
    } 
} 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getLayoutParams, setLayoutParams, setColumnWidth, setHorizontalSpacing, setNumColumns
This code example shows how to use the following methods: setOverScrollMode, setColumnWidth, setGravity, setNumColumns, setVerticalSpacing
	public GridViewFragment() { 
		super(); 
	} 
 
	public void setUpGridView(GridView gv) {
		gv.setColumnWidth(200);
		gv.setGravity(Gravity.CENTER);
		gv.setOverScrollMode(View.OVER_SCROLL_ALWAYS);
		gv.setNumColumns(GridView.AUTO_FIT);
		gv.setVerticalSpacing(15);
	} 
	 
	@Override 
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	} 
 
	@Override 
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setGravity, setHorizontalSpacing, setNumColumns, setStretchMode, setVerticalSpacing
		this.mResources = context.getResources();
		init(); 
	} 
	 
	private void init() { 
		mGridView = new GridView(mContext);
		mGridView.setNumColumns(4);
		mGridView.setHorizontalSpacing(10);
		mGridView.setVerticalSpacing(10);
		mGridView.setStretchMode(GridView.STRETCH_COLUMN_WIDTH);
		mGridView.setGravity(Gravity.CENTER);
		mGridView.setOnItemClickListener(this);
		setAdapterData(menu_name, menu_image);
	} 
 
	private void setAdapterData(String[] menus_name,String[] menus_image) {
		/** 数据源  **/ 
		ArrayList<HashMap<String, Object>> data = new ArrayList<HashMap<String, Object>>();
		/** 添加数据 **/ 
		 for (int i = 0; i < menus_name.length; i++) {            
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setPadding, setFastScrollEnabled, setAdapter, setColumnWidth, setHorizontalSpacing
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

setVerticalSpacing Method Overview
Set the amount of vertical (y) spacing to place between each item in the grid.
See Code Examples for other Android GridView Methods: