在android工作室完成背景运动图像?

时间:2016-04-12 14:53:27

标签: java android animation

我使用以下代码从右向左移动图像。我想要的是中途停止图像,然后重置,我希望我的图像克隆自己,并从每个步骤添加一个从右到左的完整滚动背景。

    ImageView img_animation = (ImageView) findViewById(R.id.imageView4);

    TranslateAnimation animation = new TranslateAnimation(0.0f, -300.0f,0.0f,    0.0f);          //  new TranslateAnimation(xFrom,xTo, yFrom,yTo)
    animation.setDuration(9000);  // animation duration
    animation.setRepeatCount(6);  // animation repeat count
    animation.setRepeatMode(0);   // repeat animation (left to right, right to left )
    animation.setFillAfter(true);

    img_animation.startAnimation(animation);

问题是只有1张图像会移动,但我希望该图像能够自行校对并从右向左滚动。

0 个答案:

没有答案