How to avoid flickering while updating gridview?

前端 未结 9 2196
谎友^
谎友^ 2021-01-05 07:01

I have a gridview. Im displaying images from the array of 10 images. After 1 minute i\'m adding 5 more images. To update the gridview i\'m using the following code.

<
9条回答
  •  孤城傲影
    2021-01-05 07:49

    If your adapter has stable ids, override hasStableIds to return true.

    Grep the android.GridView source code here, it allows the grid view to reuse a view for the same data rather than do a full redraw. This might help in the OP's case, because by default hasStableIds returns false.

提交回复
热议问题