Code example for GridView

Methods: setNumColumnssetStretchMode

0
      
    /**这个函数就是得到我们要生成的View,这里实际上直接从布局得到,  
    *我们定义的是一个GridView ,一个GridView用于显示一屏的应用程序*/   
    public View makeView() { 
    	 
    	GridView gridView = new GridView(context);
    	gridView.setNumColumns(4);
    	gridView.setStretchMode(GridView.STRETCH_COLUMN_WIDTH);
    	return gridView ;
        //return mInflater.inflate(R.layout.slidelistview, null);  
    }  
}  
Contextual code suggestions in your IDE  Get Codota for Java