动画第九步->AnimatorSet:联合动画xml实现

极客学院Animation教程讲解的很详细,点击进入哦

这里为学习的整理和补充O(∩_∩)O

一、xml中标签对应的Animator

:对应 ValueAnimator
:对应 ObjectAnimator
:对应 AnimatorSet

二、:对应 ValueAnimator


ValueAnimator valueAnimator = (ValueAnimator) AnimatorInflater.loadAnimator(context,
            R.animator.value_animator);
valueAnimator.start();

三、:对应 ObjectAnimator


ObjectAnimator animator = (ObjectAnimator) AnimatorInflater.loadAnimator(context,
        R.animator.object_animator);
animator.setTarget(mTv1);
animator.start();

四、:对应 AnimatorSet


    

    

    
        ...
    

AnimatorSet set = (AnimatorSet) AnimatorInflater.loadAnimator(MyActivity.this,
        R.animator.set_animator);
set.setTarget(mTv1);
set.start();

demo:



    
    

你可能感兴趣的:(动画第九步->AnimatorSet:联合动画xml实现)