2

我试图在图像视图中从上到下再向后移动图像..但图像似乎停留在原地并且根本不动。我尝试了动画类型,但它不起作用..这是代码..

    setContentView(R.layout.game);
    AnimationSet set=new AnimationSet(true);
    Animation animation=new TranslateAnimation(0,2000,0,1220);
    ImageView img =new ImageView(this);
    img.setImageResource(R.drawable.dig);
    animation.setDuration(3000);
    animation.setFillAfter(true);
    set.addAnimation(animation);
    set.startNow();
4

1 回答 1

1

要移动图像,您可以尝试表面视图这里是一个很好的教程如何移动图像

看到这个链接会帮助你

http://www.edu4java.com/androidgame/androidgame3.html

于 2012-05-15T11:39:45.667 回答