How can I dynamically add images to a GridView?

后端 未结 2 1299
无人及你
无人及你 2020-12-17 05:18

I have a GridView that is created based on an array of items. I need to add more images as the grid is scrolled to the bottom, but I\'m not sure how to do that.

2条回答
  •  执笔经年
    2020-12-17 05:41

    You should be able to call getAdapter on the gridview. Or -- it might not be the best practice -- but you could make the Adapter static, which would let you have access from your Grid Activity. Then, you could add images to the adapters on the fly and reset your layout.

    Give it a try. It's what I would do. If you find a better way let me know!

提交回复
热议问题