`
hilary3113
  • 浏览: 262463 次
  • 性别: Icon_minigender_1
  • 来自: 邯郸
社区版块
存档分类
最新评论

ObjectAnimator Property

 
阅读更多

The property animation system can animate Views on the screen by changing the actual properties in the View objects. In addition, Views also automatically call the invalidate() method to refresh the screen whenever its properties are changed. The new properties in the View class that facilitate property animations are:

  • 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.
  • rotationrotationX, 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).

To animate a property of a View object, such as its color or rotation value, all you need to do is create a property animator and specify the View property that you want to animate. For example:

ObjectAnimator.ofFloat(myView,"rotation",0f,360f);

For more information on creating animators, see the sections on animating with ValueAnimator andObjectAnimator.

 

链接:http://developer.android.com/intl/zh-cn/guide/topics/graphics/prop-animation.html#property-vs-view

分享到:
评论

相关推荐

    ObjectAnimator

    Property Animation 中 ObjectAnimator的基本用法大全

    PropertyAnimation

    android的属性动画示例 详细介绍了 objectanimator animationset等的使用

    Android中Property Animation属性动画编写的实例教程

    Android提供了几种动画类型:View Animation 、Drawable Animation 、Property Animation 。View Animation相当简单,不过只能支持简单的缩放、平移、旋转、透明度基本的动画,且有一定的局限性。比如:你希望View有...

    Android中编写属性动画PropertyAnimation的进阶实例

    PropertyAnimation,属性动画,顾名思义就是利用对象的属性变化形成动画的效果。属性动画的类可以用Animator这个抽象类来表示,通常使用它的子类:AnimatorSet和ValueAnimator,同时ValueAnimator有两个子类分别是...

    DemoPropertyAnimation:这是Ice Tea 09关于Android中的Property Animation的帖子的演示应用程序

    这是Ice Tea 09关于Android中的Property Animation的帖子的演示应用程序。 链接: 在这篇文章中,您将了解: Android属性动画概述 比较属性动画和查看动画 如何使用ValueAnimator 如何使用ObjectAnimator 如何...

    Android源码解析之属性动画详解

    前言 大家在日常开发中离不开动画,属性动画更为强大,我们不仅要知道如何使用,更要知道他的原理。...public static ObjectAnimator ofInt(Object target, String propertyName, int... values) { ObjectAnimator

    图文详解Android属性动画

    Android中的动画分为视图动画(View Animation)、属性动画(Property Animation)以及Drawable动画。从Android 3.0(API Level 11)开始,Android开始支持属性动画,本文主要讲解如何使用属性动画。关于视图动画可以...

    android 实现控件搜索折叠效果 Animation动画折叠和普通折叠

    android 实现控件搜索折叠效果 Animation动画折叠和普通控件直接折叠效果; 原理很简单,都是获取... ObjectAnimator anim = ObjectAnimator.ofInt(expandVp, ANIM_PROPERTY, start, end); 具体实现可以下载demo查看

    nineoldandroids-2.1.1.jar

    备用资源META-INF/MANIFEST.MF ...com.nineoldandroids.animation.ObjectAnimator.class com.nineoldandroids.animation.PreHoneycombCompat.class com.nineoldandroids.animation.PropertyValuesHolder.class ...

    Android代码-动态波浪效果的视图

    WaveView A view to display wave effect. Screenshot Integration ...Setter methods: setWaveShiftRatio - Shift the wave ...ObjectAnimator waveShiftAnim = ObjectAnimator.ofFloat( mWaveView, "waveS

    android:安卓开发

    android ObjectAnimator and ValueAnimator自Android 3.0版本开始,系统给我们提供了一种全新的动画模式,属性动画(property animation)新引入的属性动画机制已经不再是针对于View来设计的了,也不限定于只能实现...

    Android动画实现原理和代码

    我们都知道,漂亮的用户界面是衡量一款应用”好坏”很重要的依据,因为人...在Android中我们一般将动画分为两类,一类是View Animation(视图动画),一类是Property Animation,当然也有说分为三种,Frame Animation,Twe

    Android动画 实现开关按钮动画(属性动画之平移动画)实例代码

    另外说到动画,在Android里面支持3种动画: 逐帧动画(Frame Animation)、补间动画(Tween Animation)和属性动画(Property Animation),至于这几种动画的区别这里不再介绍,希望开发者都能在使用的过程中体会两者的...

    android群雄传

    7.2.1 ObjectAnimator 166 7.2.2 PropertyValuesHolder 168 7.2.3 ValueAnimator 168 7.2.4 动画事件的监听 168 7.2.5 Animator Set 169 7.2.6 在XML中使用属性动画 170 7.2.7 View的animate方法 170 7.3 ...

    Android--UI-新手必备源码master.zip

    包括Android布局,弹窗,配色,单击事件,UI,精美炫酷的activity切换动画和空间动画,是新手必备的源码,内含相关的Dome 25件。 - - 文件夹 PATH 列表 卷序列号为 4E8D-6931 C:. │ .txt │ Android-UI-新手必备...

Global site tag (gtag.js) - Google Analytics