How to avoid flickering while updating gridview?

前端 未结 9 2197
谎友^
谎友^ 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:59

    You should enable OpenGL and hardware acceleration:

    
    
    
    

    You can also using hardware caching on items of your gridview:

    view.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
    

    Finally, you can overlay your grid view during update and play with transparency.

提交回复
热议问题