简体   繁体   English

快速滚动时,listview会重置/跳转到顶部

[英]listview resets/jumps to top when scrolling fast

I have a listview in a fragment that on a fast scroll, it jumps back to the top of the list. 我在一个片段中有一个listview,可以快速滚动,它跳回到列表的顶部。 Sometimes it happens if you scroll really slowly too. 有时候,如果您滚动得太慢,也会发生这种情况。

It seems to only happen on Galaxy Nexus and Galaxy S3, both of which are on 4.3. 这似乎只发生在Galaxy Nexus和Galaxy S3上,它们都在4.3上。 All other test devices we have are on 4.4 and they work fine. 我们拥有的所有其他测试设备都在4.4上,并且可以正常工作。

I am seeing absolutely nothing in the logs when this happens, and am completely lost as to why this might happen. 发生这种情况时,我在日志中完全看不到任何东西,并且完全不知道为什么会发生这种情况。

I would post code, but there is a hell of a lot involved including animations on new items appearing and stuff. 我会发布代码,但是涉及很多方面,包括出现的新项目和内容上的动画。 However, I've removed a lot of the code for animations and what not, with comments and I still get the list jumping back to the top. 但是,我删除了很多动画代码,并删除了一些代码,并添加了注释,但列表仍然回到顶部。

Anyone experience this? 任何人都经历过吗?

I might have stumbled upon a fix for that problem. 我可能偶然发现了解决该问题的方法。 I had a problem where fastScroll would bug out when some of the elements where set to hidden and it would scroll a bit and then jump back to top. 我有一个问题,当某些元素设置为隐藏时,fastScroll会出错,它会滚动一些然后跳回到顶部。

But after adding FooterView (empty one with paddingBottom: 16dp) to ListView would remove that jumping bug. 但是在将FooterView(带有paddingBottom:16dp的空白)添加到ListView之后,将删除该跳跃的bug。 Hopefully it helps you to fix it. 希望它可以帮助您修复它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM