Android set the GridView to have 2 columns per row only

前端 未结 2 1019
别那么骄傲
别那么骄傲 2020-12-15 04:28

Here is my code in my Activity:

public class GridViewActivity extends Activity {

    GridView gridView;

    static final String[] MOBILE_OS = new String[]          


        
2条回答
  •  情书的邮戳
    2020-12-15 04:56

    you can also set number of columns by programmatically in a GridView in following way:-

     gridview.setNumColumns(n);
    

    where 'n' is the number of columns.

提交回复
热议问题