Android中如何制作翻页效果?
谁能告诉我如何在Android中制作翻页效果?
任何人都可以给我提供一些代码片段吗?
Can any one tell me how to make page turn effect in Android?
Can any one please provide me some code snippet.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看 这个。
它是一个计算器应用程序,可通过滑动手势在正常/科学模式之间切换:
它使用 TranslateAnimation 来实现效果,但在视图之间拖动并跟踪手指(就像在 iPhone 中一样)并未实现。尝试使用
它。
至于Flexbook之类的组件,它应该不难实现,如果你使用掩蔽方法。
Android M3(1.0 之前的版本)甚至有 PageTurner 小部件,但它已被弃用,因为它不像其他小部件那样足够通用。您可以尝试挖掘旧的 Android 源代码以找到 PageTurner 的实现并针对 Cupcake/Donut 进行修改。
Take a look at this.
It's a Calculator application, which changes between normal/scientific mode on swipe gesture:
It uses
TranslateAnimation
to accomplish the effect, but dragging between the views and tracking your finger, like in the iPhone is not implemented. Try usingfor that.
As for Flexbook-like component, it shouldn't be hard to implement, if you use the masking approach.
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.