How can I make my page slide as the user slides finger on the screen?(当用户在屏幕上滑动手指时,如何使我的页面滑动?)
问题描述
当用户在屏幕上滑动手指时,如何使我的页面滑动?任何示例代码?
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.
这篇关于当用户在屏幕上滑动手指时,如何使我的页面滑动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:当用户在屏幕上滑动手指时,如何使我的页面滑动?


基础教程推荐
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01