GridLayout(not GridView) - Spaces between the cells

后端 未结 1 1340
無奈伤痛
無奈伤痛 2020-12-03 17:58

I am using GridLayout(support) for displaying ImageViews in my application. There are 3 columns and 5 rows. The problem is that the cells in the

1条回答
  •  春和景丽
    2020-12-03 18:17

    Found the solution.

    Making the following changes removed the spacings.

    gridLayout = (GridLayout) findViewById(R.id.gridlayout_main);
    gridLayout.setUseDefaultMargins(false);
    gridLayout.setAlignmentMode(GridLayout.ALIGN_BOUNDS);
    gridLayout.setRowOrderPreserved(false);
    

    Refer to the image below.

    enter image description here

    0 讨论(0)
提交回复
热议问题