GridView setVerticalSpacing - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for GridView setVerticalSpacing method.

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
Connect your IDE to all the code out there  Get Codota for Java
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
Connect your IDE to all the code out there  Get Codota for Java
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
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: setPadding, setFastScrollEnabled, setAdapter, setColumnWidth, setHorizontalSpacing
This code example shows how to use the following methods: setPadding, setAdapter, setHorizontalSpacing, setNumColumns, setVerticalSpacing
 
		// FrameLayout mFrameLayout = new FrameLayout(this); 
		LayoutParams mLayoutParams_wrap = new LayoutParams(153, 140);
		// mFrameLayout.setLayoutParams(mLayoutParams); 
 
		mGridView = new GridView(this);
		localMainMenuAdapter = new MainMenuAdapter2(this, mList);
		mGridView.setAdapter(localMainMenuAdapter);
		mGridView.setNumColumns(COLUMN_SUM); // 设置3列。
		mGridView.setHorizontalSpacing(1);// 横向间隔
		mGridView.setVerticalSpacing(24);// 纵向间隔
		mGridView.setPadding(6, 4, 6, 0);// 设置填充
		mGridView.setOnItemClickListener(this);
		// mFrameLayout.addView(mGridView, mLayoutParams_wrap); 
		this.mScrollLayout.addView(mGridView, mLayoutParams_wrap);
	} 
 
	@Override 
	public void OnViewChange(int index) {
 
Full Snippet Info
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: setPadding, setAdapter, setHorizontalSpacing, setNumColumns, setVerticalSpacing
 
		// FrameLayout mFrameLayout = new FrameLayout(this); 
		LayoutParams mLayoutParams_wrap = new LayoutParams(153, 140);
		// mFrameLayout.setLayoutParams(mLayoutParams); 
 
		mGridView = new GridView(this);
		localMainMenuAdapter = new MainMenuAdapter2(this, mList);
		mGridView.setAdapter(localMainMenuAdapter);
		mGridView.setNumColumns(COLUMN_SUM); // 设置3列。
		mGridView.setHorizontalSpacing(1);// 横向间隔
		mGridView.setVerticalSpacing(24);// 纵向间隔
		mGridView.setPadding(6, 4, 6, 0);// 设置填充
		mGridView.setOnItemClickListener(this);
		// mFrameLayout.addView(mGridView, mLayoutParams_wrap); 
		this.mScrollLayout.addView(mGridView, mLayoutParams_wrap);
	} 
 
	@Override 
	public void OnViewChange(int index) {
 
Full Snippet Info
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: setPadding, setAdapter, setHorizontalSpacing, setNumColumns, setVerticalSpacing
 
		// FrameLayout mFrameLayout = new FrameLayout(this); 
		LayoutParams mLayoutParams_wrap = new LayoutParams(153, 140);
		// mFrameLayout.setLayoutParams(mLayoutParams); 
 
		mGridView = new GridView(this);
		localMainMenuAdapter = new MainMenuAdapter2(this, mList);
		mGridView.setAdapter(localMainMenuAdapter);
		mGridView.setNumColumns(COLUMN_SUM); // 设置3列。
		mGridView.setHorizontalSpacing(1);// 横向间隔
		mGridView.setVerticalSpacing(24);// 纵向间隔
		mGridView.setPadding(6, 4, 6, 0);// 设置填充
		mGridView.setOnItemClickListener(this);
		// mFrameLayout.addView(mGridView, mLayoutParams_wrap); 
		this.mScrollLayout.addView(mGridView, mLayoutParams_wrap);
	} 
 
	@Override 
	public void OnViewChange(int index) {
 
Full Snippet Info
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: setLayoutParams, setPadding, setGravity, setHorizontalSpacing, setNumColumns
This code example shows how to use the following methods: setPadding, setAdapter, setHorizontalSpacing, setNumColumns, setVerticalSpacing
		// FrameLayout mFrameLayout = new FrameLayout(this); 
		LayoutParams mLayoutParams = new LayoutParams(-1, -1);
		LayoutParams mLayoutParams_wrap = new LayoutParams(153, 140);
		// mFrameLayout.setLayoutParams(mLayoutParams); 
 
		mGridView = new GridView(this);
		localMainMenuAdapter = new MainMenuAdapter2(this, mList);
		mGridView.setAdapter(localMainMenuAdapter);
		mGridView.setNumColumns(COLUMN_SUM); // 设置3列。
		mGridView.setHorizontalSpacing(1);// 横向间隔
		mGridView.setVerticalSpacing(24);// 纵向间隔
		mGridView.setPadding(6, 4, 6, 0);// 设置填充
		mGridView.setOnItemClickListener(this);
		// mFrameLayout.addView(mGridView, mLayoutParams_wrap); 
		this.mScrollLayout.addView(mGridView, mLayoutParams_wrap);
	} 
 
	@Override 
	public void OnViewChange(int index) {
 
Full Snippet Info
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

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: