How to set a fixed number of rows in android gridView?

前端 未结 5 1861
余生分开走
余生分开走 2020-12-29 22:04

I am trying to create one gridView in android which have 10 rows and 10 columns.How can I set a fixed number of rows in Gridview ?

5条回答
  •  爱一瞬间的悲伤
    2020-12-29 22:55

    GridView is not really designed for this purpose, it is designed to display an indefinite amount of data in an efficient scrolling manner. If you want to create a static layout where you can discretely place items at specific locations, you should be looking at GridLayout or TableLayout instead.

提交回复
热议问题