如何清除它们在ListView的RECYCLEBIN所持的观点?所持、观点、ListView、RECYCLEBIN

由网友(倾尽余生讨你欢)分享简介:在Android的的ListView 部件,在的ListView 将举行这是从得到的意见一个适配器的getView 在一个内部类方法 RECYCLEBIN 。In Android's ListView widget, the ListView will hold the views which is got from...

在Android的的ListView 部件,在的ListView 将举行这是从得到的意见一个适配器的getView 在一个内部类方法 RECYCLEBIN

In Android's ListView widget, the ListView will hold the views which is got from getView method of an Adapter in a inner class RecycleBin.

我怎样才能清除 RECYCLEBIN 的意见,并迫使的ListView 重新创建所有的子视图。

How can I clear the views in the RecycleBin and force the ListView to recreate all the child views.

推荐答案

如果我没有记错的呼叫废止的ListView 部件将清空浏览这是目前保存在缓存中。我建议不要放空的意见的ListView的缓存由于潜在的性能问题。

If I remember correctly a call to invalidate on a ListView widget will empty the cache of Views which are currently stored. I would advise against emptying the cache of views of a ListView because of the potential performance issues.

如果你不打算使用 convertView 的项目,那么你会拥有有建行查看各个时间(导致大量的对象构造每当用户滚动)+从回收的观点占据了额外的内存 RECYCLEBIN ,永不反正使用。

If you're not going to use the convertView item then you'll end up with having to build the row view each time(resulting in a lot of objects constructed each time the user scrolls) + the extra memory occupied by the recycled views from the RecycleBin which will never be used anyway.

阅读全文

相关推荐

最新文章