【发布时间】:2014-07-22 12:15:59
【问题描述】:
TranslateAnimation animation = new TranslateAnimation(0.0f, 1552.0f,0.0f, 0.0f); // new TranslateAnimation(xFrom,xTo, yFrom,yTo)
`animation.setDuration(2000);` // animation duration
animation.setRepeatCount(100); // animation repeat count
animation.setRepeatMode(1); // repeat animation (left to right, right to left )
animation.setFillAfter(true);
pro.startAnimation(animation);
progress.startAnimation(animation); // start animation
我想要随机左动画
【问题讨论】:
-
如果你想留下随机动画然后创建一个随机 int 改变这样的偏移量:new TranslateAnimation(0.0f, random *1552.0f,0.0f, 0.0f);
-
我想要随机左动画向右移动
标签: android animation random startapp tree-left-right