Android 控件移动补间动画

    private void moveLine(ImageView imageView,float fromX,float toX,float fromY,float toY){
        AnimationSet animationSet = new AnimationSet(true);
        final TranslateAnimation animation = new TranslateAnimation(fromX, toX,fromY, toY);
        animation.setDuration(300);//设置动画持续时间
        animation.setFillAfter(true);//动画结束后是否回到原位
        animationSet.addAnimation(animation);
        imageView.startAnimation(animation);
       // animation.startNow();
    }

你可能感兴趣的:(软件)