Android动画
来源:互联网 发布:库卡机器人编程手册pdf 编辑:程序博客网 时间:2024/04/29 23:23
关于android的动画效果一共有三种
- View Animtion 即 tweened animation 补间动画
- Drawable Animation 即 frame-by-frame animation 帧动画
- Property Animation 属性动画
关于这几种动画一直没有搞清楚,最近折腾好久才发现自己搞错了
前两种动画效果,网上的教程很多,只放一篇吧
http://www.cnblogs.com/feisky/archive/2010/01/11/1644482.html
Property Animation的动画找到了一篇很详细的介绍的
- Android属性动画完全解析(上),初识属性动画的基本用法
- Android属性动画完全解析(中),ValueAnimator和ObjectAnimator的高级用法
- Android属性动画完全解析(下),Interpolator和ViewPropertyAnimator的用法
特此记录下来,免得再犯错
附上ObjectAnimator.ofFloat(Object target, String propertyName, float... values);
中第二个参数propertyName的值
- translationX and translationY :
These properties control where the View is located as a delta from its left and top coordinates which are set by its layout container.- rotation, rotationX, and rotationY :
These properties control the rotation in 2D (rotation property) and 3D around the pivot point.- scaleX and scaleY :
These properties control the 2D scaling of a View around its pivot point.- pivotX and pivotY :
These properties control the location of the pivot point, around which the rotation and scaling transforms occur. By default, the pivot point is located at the center of the object.- x and y :
These are simple utility properties to describe the final location of the View in its container, as a sum of the left and top values and translationX and translationY values.- alpha :
Represents the alpha transparency on the View. This value is 1 (opaque) by default, with a value of 0 representing full transparency (not visible).
update:
关于上面那个值,最近发现自己错了,一直懒得改这个地方。其实那个只要你在target
里面你定义一个setXxYy(float f)
这个 xxYy
就可以用在 propertyName
。很简单的,还支持:
- public static ObjectAnimator ofArgb (Object target, String propertyName, int… values)
- public static ObjectAnimator ofInt (Object target, String propertyName, int… values)
- public static ObjectAnimator ofMultiFloat (Object target, String propertyName, float[][] values)
还有一个是android.animation.ValueAnimator
,其实ObjectAnimator
也是继承自ValueAnimator
的。
- public static ValueAnimator ofArgb (int… values)
- public static ValueAnimator ofFloat (float… values)
- public static ValueAnimator ofInt (int… values)
以上还有很多方法都是提供,值的变化的,感兴趣的可以去查看文档。
- Android动画--视图动画
- Android动画--属性动画
- android动画 -- 属性动画
- Android:动画:tween动画
- Android:动画:Frame动画
- Android动画动画二
- Android动画-属性动画
- Android动画【属性动画】
- Android动画-帧动画
- Android动画--帧动画
- Android动画--属性动画
- Android动画-View动画
- android 动画 -- tween动画
- android 动画
- android动画
- android动画
- android动画
- Android动画
- Spring框架事务管理之四:Spring编程式事务
- nosetests:not found
- VS2008的程序,运行时遇到R6034错误:
- 2. Add Two Numbers(Java)
- 设计模式之命令模式(Command)
- Android动画
- 2.2 Android进程间通信(IPC)----Service Manager
- 赋值运算符重载函数 返回引用和返回对象的区别
- NavigationBar 下面的横线是怎么来的? 如何去除?
- 实现HorizontalScrollView随ViewPager滚动的简易方法
- Android屏幕适配全攻略(最权威的官方适配指导)
- xUtils简介及使用
- CMake交叉编译配置
- iOS开发之友盟推送配置教程