android 简单动画Animator

来源:互联网 发布:linux 文本全部删除 编辑:程序博客网 时间:2024/05/19 16:34
animator = ObjectAnimator.ofFloat(sliding, "translationX", 0, mheight);
//设置动画时间
animator.setDuration(40000);
//设置动画插入器,减速 
animator.setInterpolator(new DecelerateInterpolator());
//设置动画重复次数,这里-1代表无限 
animator.setRepeatCount(-1);
//设置动画循环模式。 
animator.setRepeatMode(ValueAnimator.RESTART);animator.start();//启动动画。
animator.end();
注意::当戒指结束动画,也就是animator.end();时候回直接完成动画,导致界面可能消失
原创粉丝点击