列表视图滚动相当毫无价值时therre不同的行高 [英] listview scrolls quite junky when therre are different row heights

查看:169
本文介绍了列表视图滚动相当毫无价值时therre不同的行高的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我有些问题列表视图。我的名单确实有很大的不同单元格的高度,其中一些甚至更大然后是屏幕的高度。我发现了什么,那ListView的滚动intepolator与计算惯性问题。每次当有之间目前两个小区的可视区域切换高差大的时候,滚动junks..I've看着traceview,实际上没有太大的延迟。 (有没有线tallet那么16ms的treshold,虽然有明显的区别),这意味着它其实没有垃圾,这是相当快只是加速和deccelerating滚动速度。 (它完全按照滚动条的高度变化的同时出现)
是否有人知道如何解决此问题?我读过来自Facebook的文章,他们显然有同样的issue..There写入他们需要写自己的项目回收。我有点那个的认识,并希望看到一些简单的解决方案..
对不起,这个问题如此抽象的,但我想任何code是没有必要的..
感谢您的帮助..

hi i've some problems with listview. My list do have very different cell heights, some of them are even bigger then the height of the screen. What I found out, that listview scrolling intepolator has problems with calculating the inertia. each time when there is big height difference between two cells currently switching in the visible area, the scrolling junks..I've looked into traceview and there actually is not that much of a delay. (there is no line tallet then the 16ms treshold, though there is visible difference), that means it actually does not junk and it is rather only quickly accelerating and deccelerating the scrolling speed. (it occurs in exactly the same time as the scrollbar height changes) Does anybody know how to solve this? I've read an article from facebook and they apparently had the same issue..There is written they needed to write their own item recycler. I'm kind of aware of that and would like to see some simpler solution.. Sorry for this question being so abstract, but I guess any code is not necessary.. thank you for your help..

推荐答案

列表视图回收,这已经被夸大了意见。由于你的情况在ListView具有高度不一的物品,最好是写自己的回收商。

ListViews recycle, the views that have been already inflated. Since in your case the Listview has items which vary in height, it is better to write your own recycler.

如果您有具体的类别,在X,Y和Z,那么你可以通过添加到布局的属性作为一个标签,并有条件地充气检查布局类型。但要做到这一点,最好的办法是写自己的回收。

If you have specific categories as in X, Y and Z then you can check the layout type by adding an attribute to the layout as a tag, and inflating conditionally. But the best way to do this is write your own recycler.

这篇关于列表视图滚动相当毫无价值时therre不同的行高的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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