如何使一个机器人观点,即对刷卡/一扔视图之间翻转 [英] How to make an Android view that flips between views on swipe/fling

查看:140
本文介绍了如何使一个机器人观点,即对刷卡/一扔视图之间翻转的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使我的Andr​​oid应用程序的视图上轻扫/一扔多个视图之间翻转。我想它的行为或多或少像Android的发射行为视图之间翻转时。尤其是,

I'd like to make a view in my Android app that flips between multiple views on a swipe/fling. I'd like it to behave more or less like the Android Launcher behaves when flipping between views. In particular,

  1. 应该翻盖上刷一下看法。
  2. 一般刷卡将一个视图和下之间翻转。它不应该在所有的意见一扔。
  3. 如果你慢慢刷,你应该看到的景色拖着为你刷卡,如。的方式,启动做的。

我试图用一个ViewFlipper与GestureOverlayView按这里罗曼盖伊的博客文章,但没有指标,以用户为他们刷卡。这使得可发现困难,这是presumably为什么启动做它自己的方式做。

I tried using a ViewFlipper with a GestureOverlayView as per Romain Guy's blog post here, but there's no indicator to the user as they're swiping. This makes discoverability difficult, which is presumably why Launcher does it the way they do.

我试图用一个库对象,但是当我从左至右滑动,有一定量的势头甩用户通过各方面的意见,而不是仅仅把他们带到下一个视图。

I tried using a Gallery object, but when I swipe from left to right, there's a certain amount of momentum that flings the users through all the views rather than just taking them to the next view.

有没有完成我想要做的好办法?

Is there a good way to accomplish what I'm trying to do?

推荐答案

我知道这是一个老问题,但ViewPager针对此相同目的而设立。 ViewPager是Android的兼容包和更多的一部分,可以在<一个发现href="http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html">http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html

I know this is an old question but ViewPager is created for this exact same purpose. ViewPager is part of android compatibility package and more can be found at http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html

这篇关于如何使一个机器人观点,即对刷卡/一扔视图之间翻转的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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