GridLayout崩溃问题

写类似朋友圈界面的时候有九宫格,2*2的图片展示,用的gridlayout,运行的时候会崩溃,报错如下

java.lang.IllegalArgumentException: columnCount must be greater than or equal to the maximum of all grid indices (and spans) defined in the LayoutParams of each child. 

记得在setColumnCount 或者setRowCount之前 

  gridLayout.removeAllViews();

  

posted @ 2019-03-25 14:06  Airal  阅读(629)  评论(0编辑  收藏  举报