在Android的各种动画技术? [英] kinds of animation techniques in android?

查看:106
本文介绍了在Android的各种动画技术?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是机器人类型的动画技术?

what are kinds of animation techniques in android?

u能告诉我,例如codeS,教程是什么?

can u tell me the example codes, tutorials for that?

注意:吐温和帧动画的文件中是不够的......

推荐答案

基本上,除了(很痛苦)帧/补间动画有布局的动画,查看动画和过渡动画。布局动画火的元素显示时,无论是在初始活性布局或当您设置一个视图可见,和过渡动画,当一个新的活动已经开始。标准视图动画是主力灵活的动画,你可以发射在每个视图/布局的基础上,但他们需要更多的工作(在XML定义外,活动和布局的动画一般都是单行)。

Basically, besides the (fairly painful) frame/tween animations there are layout animations, view animations and transition animations. Layout animations fire when an element is shown, either at initial activity layout or when you set a view to visible, and transition animations when a new activity is starting. Standard view animations are the workhorse flexible animations you can fire on a per view/layout basis, but they take a bit more work (outside the XML definitions, Activity and Layout animations are generally one-liners).

有也是有帮助的类,如ViewFlipper缓和与一些动画的工作。检查自带的SDK(文档这里)Android的API演示应用。易观动画是在<一个href="http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/Animation2.html">this类,在过渡<一href="http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/Animation.html">this一流的,以及一些更复杂的例子<一href="http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/animation/index.html">here (有一个在2.0 API的演示应用程序的布局动画的例子,但我不能找到它的在线文档)。一定要检查出相关的XML在RES /动画,太演示;动漫XML文档中的规格是有点稀疏,但也有很多很好的例子,在API演示和Android源$ C ​​$ C。您可以使用XML来定义转换(淡入淡出,卷动等)和内插(加速,过冲等)两种类型,这给权力相当数量(足以满足大多数使用案例,反正)。

There are also helpful classes like ViewFlipper to ease working with some of the animations. Check the Android API Demos application that comes with the SDK (documentation here). Easy view animations are in this class, transitions in this class, and some more complex examples here (there's a layout animation example in the 2.0 API demo app, but I can't find it in the online docs). Be sure to check out the related XML for the demos in res/anim, too; the spec on animation XML in the documentation is a bit sparse, but there are plenty of good examples in the API demos and Android source code. You can use XML to customize both the type of transitions (fade, scroll, etc.) and the interpolations (accelerate, overshoot, etc.), which gives a fair amount of power (enough to cover most use cases, anyways).

的<一个href="http://developer.android.com/reference/android/view/animation/AnimationUtils.html">AnimationUtils类可以有很大的帮助,太。通过Android系统源$ C ​​$ C快速的grep应该给你一些伟大的工作材料,上述所有。这些资源应该足以让你开始;祝你好运!

The AnimationUtils class can help a lot, too. A quick grep through the Android system source code should give you some great working material for all the above. These resources should be enough to get you started; good luck!

补遗(5/2011):另外还有一个(3.0+只)属性动画系统,这是真的很酷,因为你可以用它来设置动画自定义视图任意属性;除非你正在写一个3.0特定的应用程序,你需要在使用前等待。

ADDENDUM (5/2011): There's also the (3.0+ only) property animation system, which is really cool because you can use it to animate arbitrary properties on custom views; unless you're writing a 3.0-specific app, you'll need to wait before using it.

这篇关于在Android的各种动画技术?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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