简体   繁体   English

以编程方式顺畅地滚动ListView

[英]Scroll ListView smoothly and programmatically

I have searched a lot but I couldn't find an answer. 我搜索了很多,但我找不到答案。

I want to implement something like in Go Launcher. 我想在Go Launcher中实现类似的功能。 When you drag an icon in app drawer and move it out of container top or bottom bound, the list begins to scroll. 当您在应用程序抽屉中拖动图标并将其移出容器顶部或底部边界时,列表开始滚动。 So far, I have tried following things: 到目前为止,我尝试过以下事项:

  1. Dispatch touch events to simulate scrolling - impossible while touching the screen 发送触摸事件以模拟滚动 - 触摸屏幕时不可能

  2. Use smoothScrollBy() method - almost there, but it scrolls only screen height distance 使用smoothScrollBy()方法 - 几乎在那里,但它只滚动屏幕高度距离

  3. Use scrollBy() - it moves only the container and leaves blank space. 使用scrollBy() - 它只移动容器并留下空白。 I would put there some rows if only I could be able to reuse views that went off the screen. 如果我能够重用屏幕上的视图,我会放一些行。

I need the ListView to scroll SMOOTHLY. 我需要ListView滚动SMOOTHLY。

So here goes ma question. 所以这里有问题。 Anybody knows how can it be done? 谁知道怎么办? I'll put a gratitude in About section of my app to person who will help me:) 我会感谢我的应用程序部分给那些会帮助我的人:)

使用listview并尝试scrollToPosition()或smoothscrollBy()

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

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