卧式]分页"视图之间十岁上下滚动 [英] Horizontal "tab"ish scroll between views

查看:129
本文介绍了卧式]分页"视图之间十岁上下滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我感兴趣的创建捕捉到看项目,所以只有一个项目是有史以来一次显示的水平滚动视图。用户可以触摸拖动左/右,将看到previous /下一个意见,切换到它,如果有足够的速度。这种互动是完全一样什么都带有一种不为它的标签之间导航Nexus的新气象/新闻小工具。

I'm interested in creating a horizontal scroll view that "snaps" to the viewed item, so only one item is ever shown at a time. The user can touch-drag left/right and will see previous/next views, switching to it if there's enough velocity. This interaction is exactly like what the new weather/news widget that comes with the Nexus One does for navigating between its "tabs".

是否有任何现有的视图控件是做到这一点?

Are there any existing view widgets that do this?

更新:发现新闻/天气小工具(GenieWidget)的副本,他们似乎已经实现了自己的小部件来实现这一点,他们称之为 com.google.android.apps.genie.geniewidget。 ui.FlingableLinearLayout 这是他们自己的自定义 com.google.android.apps.genie.geniewidget.ui.TabView 部分。由于该源不可用,这不看太乐观的方向。

Update: found a copy of the news/weather widget (GenieWidget) and they seem to have implemented their own widget to accomplish this which they call com.google.android.apps.genie.geniewidget.ui.FlingableLinearLayout which is part of their own custom com.google.android.apps.genie.geniewidget.ui.TabView. As that source isn't available, that's not looking too hopeful a direction.

推荐答案

(更新20110905:官方<一href="http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html?m=1"相对=nofollow> Android的工具现在做得更好)

(update 20110905: Official android tools now do this better)

我克隆埃里克Taix的 HTTP://$c$c.google.com / P /雄-意见/ 在github

I cloned Eric Taix's http://code.google.com/p/andro-views/ on github

https://github.com/olibye/AndroViews

那么应用的补丁,从上面的:

Then applied the patches from above:

  • 城野的补丁

  • JonO's patch

汤姆·德Waard的补丁

Tom de Waard's patch

分割成一个图书馆和一个例子,让简单的​​纳入其他项目

Split into a library and an example, allowing simple inclusion in other projects

我会作出此评论上面,但是我没能出现在城野的回答进行评论

I would have made this comment above, however I didn't appear able to comment on JonO's answer

这篇关于卧式]分页&QUOT;视图之间十岁上下滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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