How to cenralize last uneven row in GridView in android?

后端 未结 4 1943
北海茫月
北海茫月 2020-12-11 03:03

I have a GridView , which displays pictures of alphabets what happens is , every time in the last row there are less no of alphabets. and the last row is left a

4条回答
  •  春和景丽
    2020-12-11 03:57

    For those who are still looking for a solution for this here's my take for this, create a TableLayout and, and for each TableRow set its weigth to android:weightSum="4" and dont forget to add android:gravity="center"

    For complete code check this gist for reference.

提交回复
热议问题