如何将图像滑动到屏幕的左上角?
请参阅我的图片
此动画应该很慢
我尝试使用以下代码但不起作用!
public Animation fromAtoB(View v, float fromX, float fromY, float toX, float toY, int speed, AnimationListener l)
{
Animation fromAtoB = new TranslateAnimation(Animation.ABSOLUTE, fromX, Animation.ABSOLUTE, toX, Animation.ABSOLUTE, fromY, Animation.ABSOLUTE, toY );
fromAtoB.setDuration(speed);
if(l != null)
{
fromAtoB.setAnimationListener(l);
}
v.setAnimation(fromAtoB);
v.startAnimation(fromAtoB);
return fromAtoB;
}
请告知,谢谢