当使用clipToPadding在ListView的项目得到回收prematurely [英] When using clipToPadding in ListView's the items get recycled prematurely

查看:133
本文介绍了当使用clipToPadding在ListView的项目得到回收prematurely的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

设置时,

android:clipToPadding="false"

在2.3.3 Android设备我看到的列表项正在被回收prematurely在一个标准的ListView。适配器的观点被删除时,它完全滚过的填充与被滚动过去导致被删除的看法为时尚早屏幕的边缘。有没有人能解决这个问题呢?

in a standard ListView on a 2.3.3 android device I am seeing that the list items are being recycled prematurely. The adapter's view is being removed when it is fully scrolled past the padding versus being scrolled past the edge of the screen resulting in views being removed too early. Has anyone been able to solve this issue?

推荐答案

剪辑来填充是默认的行为。有尽快回收的观点,因为它是不可见的(即过去的填充)是正常的和预期的行为。

Clip to padding is the default behavior. Having the view recycled as soon as it's not visible (i.e. past the padding) is the normal and expected behavior.

你确定你是不是要设置 clipToPadding ?在这种情况下,ListView控件仍然会尽快为他们进入填充区域回收它的孩子。属性 clipToPadding 只影响绘图,并没有考虑到布局算法,如的ListView 的。我们可以解决这个问题,在平台的未来版本,但不会帮助你,现在,对不起:(

Are you sure you're not trying to set clipToPadding to false? In that case, ListView will still recycle its children as soon as they enter the padding area. The attribute clipToPadding only affects drawing and is not taken into account by layout algorithms such as ListView's. We could fix this behavior in a future version of the platform but that won't help you right now, sorry :(

这篇关于当使用clipToPadding在ListView的项目得到回收prematurely的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆