如何滚动"无限"在Android的宽视野? [英] How to scroll "infinitely" wide view in Android?

查看:101
本文介绍了如何滚动"无限"在Android的宽视野?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我琢磨如何滚动的无限,鳞片状,控制Android的替代品。最简单的想法是重绘每卷动整个视图,但不知何故,似乎并不像正确的方法。这是可能的前手画的内容,但我不知道我应该怎么做广泛的观点摆在首位,并在用户滚动时,发生了观点的到底是什么?我想我需要扩展朝着那个方向的看法。

I am pondering the alternatives on how to scroll an "infinite", scale-like, control in android. The simple idea is to redraw the entire view on each scroll movement, but somehow it doesn't seem like the proper way. It is possible to draw the contents before-hand, but I have no clue how wide I should make the view in the first place, and what happens when the user scrolls to the end of the view? I guess I need to extend the view towards that direction.

我应该去对编程添加(和删除)的视图块线性布局?这将是巨大的,听到的经历都在那里就画这种长期滚动的自定义控制。

Should I go towards programatically adding (and removing) chunks of view to a linear layout? It would be great to hear what experiences are out there regarding drawing this kind of long-scrolling custom control.

谢谢 /埃里克

推荐答案

如果您正在使用列表/网格或使用适配器的数据什么,你可以用一个最优秀的班级写CommonsWare并请访问:

if you are working with list/grid or anything that uses Adapter for data, you can use a most excellent class written by CommonsWare and available here:

http://github.com/commonsguy/cwac-endless

这是专门为这个目的

这篇关于如何滚动"无限"在Android的宽视野?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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