Android 将图像滑出屏幕
如何将图像滑动到屏幕左上角 请看我的照片 这个动画应该很慢 我尝试了以下代码,但不起作用Android 将图像滑出屏幕,android,Android,如何将图像滑动到屏幕左上角 请看我的照片 这个动画应该很慢 我尝试了以下代码,但不起作用 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.ABS
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;
}
请告知,谢谢