`
zsnlovewl
  • 浏览: 175469 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

animation知识学习

阅读更多

LinearInterpolator


变化率是个常数,即 f (x) = x.

方法:public float getInterpolation(float input)

AccelerateInterpolator--开始变化很慢,然后逐渐变快,即 f(x) = x*x 或者 f(x) = pow(x, 2*mFactor).

方法:public float getInterpolation(float input)

AccelerateDecelerateInterpolator--变化率开始和结束都很慢,但中间很快,即 f(x) = (cos ((x+1)*PI) / 2.0f) + 0.5f.

方法:public float getInterpolation(float input)

LinearInerpolator、AccelerateInterpolator, DecelerateInterpolator, AccelerateDecelerateInterpolator,CycleInterpolator 是 Interpolator 的子类,分别实现了匀速、加速、减速、变速、循环等效果。

AlphaAnimation

控制透明度

构造函数:

@param开始的透明度

@param结束的透明度

AlphaAnimation(float fromAlpha, float toAlpha)

方法:

willChangeBounds()                                     具体不详,不过其返回值是固定的都是false

willChangeTransformationMatrix()         false

ScaleAnimation

控制尺寸

构造函数:

@param开始时x方向的伸缩比列

@param结束时x方向的伸缩比列

@param开始时y方向的伸缩比列

@param结束时y方向的伸缩比列

ScaleAnimation(float fromX, float toX, float fromY, float toY)

@param动画在x轴的伸缩位置0%-100%中取值,50%为物件的X或Y方向坐标上的中点位置

@param动画在y轴的伸缩位置

ScaleAnimation(float fromX, float toX, float fromY, float toY, float pivotX, float pivotY)

@param  pivotXType动画在X轴相对于物件位置类型--固定的一些数据

@param  pivotYType动画在X轴相对于物件位置类型

pivotXValue,pivotYValue同上面的pivotX,pivotY

ScaleAnimation(float fromX, float toX, float fromY, float toY,int pivotXType, float pivotXValue, int pivotYType, float pivotYValue)

方法:

     initialize(int width, int height, int parentWidth, int parentHeight)设置动画的大小根据父类的维数(猜测)

TranslateAnimation

移动

构造函数:

@param开始时x的位置

@param结束时x的位置

@param开始时y的位置

@param结束时y的位置

TranslateAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta)

@param参考上面ScaleAnimation的

TranslateAnimation(int fromXType, float fromXValue, int toXType, float toXValue,int fromYType, float fromYValue, int toYType, float toYValue)

方法:

@param同ScaleAnimation的

initialize(int width, int height, int parentWidth, int parentHeight)

RotateAnimation

旋转

构造函数:

@param开始的角度

@param结束的角度

RotateAnimation(float fromDegrees, float toDegrees)

@param动画在x轴的旋转位置

@param动画在x轴的旋转位置

RotateAnimation(float fromDegrees, float toDegrees, float pivotX, float pivotY)

方法:

@param同ScaleAnimation的

         initialize(int width, int height, int parentWidth, int parentHeight)

Animation

抽象类,所有控制动画的都继承与该类

Aniamtion 是基类,他记录了动画的通用属性和方法。主要的属性包括动画持续时间、重复次数、interpolator等。

方法:---只列举了几个方法,用法很简单,可以去看sdk

getTransformation (currentTime, outTransformation)

该方法根据当前时间 (currentTime) 和 interpolator,计算当前的变换,在 outTransformation 中返回。

setRepeatMode(int)—在测试AnimationSet是该函数没有成功,可能有什么地方设置错了,以后再跟进

@param Animation.RESTART回到动作开始时的坐标,Animation.REVERSE反转的意思,a->b,在从b->a,Animation.INFINITE不断重复该动作

设置动作结束后,将怎样处理,只有在repeatCount大于0或为INFINITE的时候setRepeatMode才会生效

TranslateAnimation、RotateAnimation、AlphaAnimation、ScaleAnimation等是Animation的子类,分别实现了平移、旋转、改变透明度、缩放等动画。

AnimationSet

设置一个动画组,就是将一系列动作合在一起形成新的动画

可以包含多个Animation,但都是在同一个时间执行的,是并行,不是串行执行的。如果AnimationSet中有一些设定,如duration,fillBefore等,它包含的子动作也设定了的话,子动作中的设定将会给覆盖掉。

构造函数:

     @param是否公用动画插入器,为true表示共用AnimationSet的插入器

AnimationSet(boolean shareInterpolator)

方法:==

     @param为true时将在播放完后被应用,播完后停在最后一幅画上,这里重写了Animation的该方法,其他的基本上都是直接使用父类的

     setFillAfter(boolean fillAfter)

@param为true时将在开始前被应用,播完后停在第一幅画上,好像不设置该属性也会停留在最开始的那副上面

setFillBefore(boolean fillBefore)

@param在使用AnimationSet的重复mode时,还没有看到有什么效果,但是它的解释和Animation的该方法是一样的

setRepeatMode(int repeatMode)

@param动画停留时间间隔,从上次结束后停留多长时间进入下一次动画

setStartOffset(long startOffset)

@param添加动画

addAnimation(Animation a)

Example

AnimationSet aa = new AnimationSet(true);

    Animation myAnimaton = new TranslateAnimation(0,100,0,100); 

    aa.addAnimation(myAnimaton);

    Animation myAnimaton1 = new RotateAnimation(0,360);

    aa.addAnimation(myAnimaton1);

    myImage.startAnimation(aa);

    aa.start();

    aa.setDuration(2000);

aa.setFillAfter(true);

AnimationUtils

该类没有父类,动画的辅助类.构造函数也没有,使用默认的

方法:

@param可以看到不需要实例化该对象就可以使用,通过资源xml获得一个动画

static Animation loadAnimation(Context context, int id)

TranslateAnimation manmation = (TranslateAnimation)AnimationUtils. loadAnimation(this,R.anim.animation);

@param

LayoutAnimationController loadLayoutAnimation(Context context, int id)

LayoutAnimationController

Layout animation controller is used to animated a layout's, or a view group's, children.

该类和其衍生类GridLayoutAnimationController,GridLayoutAnimationController.AnimationParameters等还没有看到相关资料,也没有用过

Animation.Description

Utility class to parse a string description of a size. 

GridLayoutAnimationController

A layout animation controller is used to animated a grid layout's children.

GridLayoutAnimationController.AnimationParameters

The set of parameters that has to be attached to each view contained in the view group animated by the grid layout animation controller.

LayoutAnimationController.AnimationParameters

The set of parameters that has to be attached to each view contained in the view group animated by the layout animation controller.

Transformation                                                                      

Defines the transformation to be applied at one point in time of an Animation.

在xml文件中设置动画可以参考android_xml文件中介绍的,有实例解释

 

AlphaAnimation
 渐变透明度动画效果
 
ScaleAnimation
 渐变尺寸伸缩动画效果
 
TranslateAnimation
 画面转换位置移动动画效果
 
RotateAnimation
 画面转移旋转动画效果
 

transition设置两张图片的过渡,好像只能设置两张之间的过渡,多设置几张也只显示前面两张

 

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/lishubing1126/archive/2009/12/02/4926770.aspx

分享到:
评论

相关推荐

    ios-CoreAnimation核心动画学习.zip

    这个“ios-CoreAnimation核心动画学习.zip”压缩包很可能是为了帮助开发者深入理解并掌握Core Animation的关键概念和使用方法。下面我们将详细探讨Core Animation的核心知识点。 Core Animation并非是一个完整的...

    Core Animation动画例子

    通过这个“Core Animation动画例子”压缩包,你可以学习到如何在实践中运用上述知识点,创建出流畅、精致的iOS应用动画效果。记住,实践是最好的老师,深入研究并动手尝试这些示例,将有助于你更好地掌握Core ...

    android动画例子:tween animation and property animation

    以下是一些关于Tween Animation的重要知识点: 1. **Animation类**:所有Tween Animation的基础类,提供动画的基本结构和行为。 2. **TranslateAnimation**:用于对象的平移,可以设置X和Y轴的位移。 3. **...

    Animation Fundamentals Rigs v1_Animation_Fundamentals_

    在"Animation Fundamentals"这个标签下,我们可以期待一系列围绕3D动画基础知识的教学内容。这可能包括但不限于骨骼绑定(rigging)、关键帧设置、运动路径、物理模拟以及表情动画等核心概念。Rig,即角色的骨骼系统...

    教你使用coreAnimation

    通过学习和实践这些Core Animation的知识点,初学者可以逐步掌握创建动画的技巧,为iOS应用增添生动性和趣味性。在项目"alexisgo-AnimationTalk-09ce067"中,你可以找到更多示例和代码片段,帮助你深入理解并运用...

    core animation

    - **Daniel Jalkut**:强调Core Animation对于Cocoa程序员的重要性,并认为本书是学习该技术的好伴侣。 #### 结论 《Core Animation for Mac OS X and the iPhone》是一本不可或缺的资源,它不仅提供了对Core ...

    Animation

    这里的"NULL"描述可能是由于原始信息缺失,但我们可以从通常的Android Animation知识体系出发进行深入探讨。 Android动画主要包括两种类型:属性动画(Property Animation)和视图动画(View Animation)。属性动画...

    Scratch Animation

    在"Scratch Animation"的学习中,你会接触到以下几个关键知识点: 1. **基本操作**:了解如何注册和登录Scratch账号,创建新项目,以及界面的基本布局,包括舞台区、脚本区、角色列表和背景选择器。 2. **角色与...

    A_GUIDE_TO_IOS_ANIMATION_2.0.pdf )中文高清彩板,Kitten的iOS 动画学习手册

    标题《A_GUIDE_TO_IOS_ANIMATION_2.0.pdf》揭示了这份文档是一本关于iOS动画的学习手册的第二版。文档的副标题为“Kitten的iOS 动画学习手册”,说明这份手册是基于Kitten这个名字的作者所编写。通过“中文高清彩板...

    Animation动画实例源代码

    在“AnimationDemoTest”这个实例中,我们可以学习到以下关键知识点: 1. **视图动画(View Animation)**: - **AlphaAnimation**:实现对象的透明度变化,可以创建淡入淡出效果。 - **TranslateAnimation**:...

    大规模知识图谱的表征学习

    评估知识图谱表征学习的效果通常通过实体预测等任务来完成,例如,给定《WALL-E》这个实体,TransE模型可以预测它与多个可能的tail实体(如Animation, Computer animation等)之间的关系。 综上所述,大规模知识...

    Android Animation Demo

    这篇详细讲解将围绕标题和描述中的知识点展开,包括Tween Animation(补间动画)和Frame Animation(帧动画),帮助开发者理解和实践Android动画。 首先,我们来探讨 Tween Animation。Tween Animation是Android中...

    Foundation AS3 Animation(中英文版)

    在学习过程中,可以参考的文件有两本PDF教程:《ReallyUsefulEbooks.com_1590597915_FriendsofED.Foundation.Actionscript.3.0.Animation.Apr.2007.eBook-BBL.pdf》和《Flash+ActionScript+3.0动画教程.pdf》,这两...

    Core Animation Programming Guide 中文翻译版

    Core Animation主要涉及以下几个关键知识点: 1. **图层(Layers)**:Core Animation的核心是CALayer对象,它代表屏幕上的一个可绘制区域。开发者可以通过设置图层的属性,如位置、大小、颜色、透明度等,来实现...

    Core Animation for Mac OS X and the iPhone 英文版

    通过阅读本书,开发者不仅可以掌握Core Animation的理论知识,还能获得实践经验,提升在Mac OS X和iPhone平台上构建高效动画和视觉效果的能力。无论是对于初学者还是有经验的开发者,这本书都是深入学习Core ...

    ASP.NET视频教程 AJAX控件之Animation

    在传统的ASP.NET中,实现动画效果通常需要深厚的JavaScript知识,但使用Animation控件,开发者可以方便地通过直观的配置界面添加和管理动画序列。 Animation控件的工作原理是通过修改DOM元素的样式属性,如位置、...

    Computer Animation, Third Edition

    总的来说,《计算机动画》第三版涵盖了计算机动画领域的广泛知识,从基本原理到高级技术,为读者提供了全面的学习资源。无论是对动画技术感兴趣的初学者,还是希望深化专业技能的开发者,都能从中受益匪浅。通过学习...

Global site tag (gtag.js) - Google Analytics