开发者

gridview of images is not getting refreshed

i have a grid view with images p开发者_运维百科opulated from a list. when i remove an image from the list,i want the grid view to get refreshed.can someone tell me how to do this.

i have tried to invalidate() the gridview, notify the image adapter that the data set has changed(adapter.notifyDataSetChanged();). but this is not giving the desired results.

after doing this i am getting a blank in the place where the image that is removed used to be before.


Try to use gridView.invalidateViews() instead of just .invalidate(). It redraws all views (ImageViews in your case) inside gridView.


Do you use a ListAdapter to populate your view ? Maybe you should recreate a new adapter when your list changes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜