如何使翻页效果的Andr​​oid? [英] How to make page turning effect in Android?

查看:117
本文介绍了如何使翻页效果的Andr​​oid?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何一个可以告诉我如何在Android的翻页效果?
任何一个可以请提供我一些code段。

Can any one tell me how to make page turn effect in Android?
Can any one please provide me some code snippet.

推荐答案

看看<一href="http://www.google.co.in/$c$csearch/p?hl=en#RzGvLIykRFs/src/com/android/calculator2/PanelSwitcher.java&q=android%20package%3Agit%3A//android.git.kernel.org%20Calculator2"相对=nofollow>这个。

这是一个计算器应用程序,在轻扫手势正常/科学的模式之间变化:

It's a Calculator application, which changes between normal/scientific mode on swipe gesture:

onFling(MotionEvent, MotionEvent, float, float)

它使用 TranslateAnimation 来实现的效果,但在iPhone上的视图之间拖动和跟踪你的手指,像不落实。尝试使用

It uses TranslateAnimation to accomplish the effect, but dragging between the views and tracking your finger, like in the iPhone is not implemented. Try using

onScroll(MotionEvent, MotionEvent, float, float)

至于 Flexbook 般的组件,它不应该是很难实现的,如果您使用的屏蔽方法。

As for Flexbook-like component, it shouldn't be hard to implement, if you use the masking approach.

Android的M3(pre-1.0版本),甚至有PageTurner小部件,但它得到了德precated,因为它不是通用的,足够的,像其他小部件。你可以尝试,挖了旧的Andr​​oid源找到PageTurner的实施和修改的蛋糕/甜甜圈。

Android M3 (pre-1.0 version) even had PageTurner widget, but it got deprecated, since it wasn't generic-enough, like the other widgets. You can try and dig up the old Android sources to find the implementation of PageTurner and modify it for Cupcake/Donut.

这篇关于如何使翻页效果的Andr​​oid?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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