How does Grid View change column number runtime?

前端 未结 3 1837
小鲜肉
小鲜肉 2021-01-28 18:10

I am trying to change gridView column number. I call setNumColumn() and invalidateViews() to update the view.

However, the grid\'s cell width w

3条回答
  •  庸人自扰
    2021-01-28 18:56

    in xml u have to provide this attribute..

     android:stretchMode="columnWidth" . In your adapter depending on the size(by  `getCount()`) of the list colomn will create dynamically..
    

提交回复
热议问题