当用户在屏幕上滑动手指时,如何使我的页面滑动? [英] How can I make my page slide as the user slides finger on the screen?

查看:24
本文介绍了当用户在屏幕上滑动手指时,如何使我的页面滑动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户在屏幕上滑动手指时,如何使我的页面滑动?任何示例代码?

How can I make my page slide as the user slides finger on the screen? Any example code?

我只需要与我的 android g-phone 主屏幕上相同的感觉.屏幕随着手指的移动而移动(也包括弹性效果).

推荐答案

看看这个 教程它的后续行动在 Warriorspoint 上.他们解释了如何使用 ViewFlipper 平滑地动画从一个屏幕到另一个屏幕的过渡,然后在第二部分中如何使用触摸控制来做到这一点.请注意,这些是全屏转换,不会在现有页面上平移.对于平移,例如对于不适合屏幕的超大图像,请查看 Android BigImage.根据您尝试执行的操作,这些操作可能有点过头了,但并不是 100% 清楚您想要实现的目标.

Check out this tutorial and its follow up on warriorpoint. They explain how to use the ViewFlipper to smoothly animate the transition from one screen to another, and then in the second part how to do this using touch control. Note, these are whole-screen transitions not panning around on an existing page. For panning, e.g. on an oversized image that doesn't fit in the screen, check out Android BigImage. Depending on what you're trying to do these might be overkill, but it's not 100% clear what you're trying to achieve.

这篇关于当用户在屏幕上滑动手指时,如何使我的页面滑动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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