如何在 android 中改变动画移动过渡中的对象方向?

How to change direction of object in move transition in animation in android?

我想改变 android 中图像的方向 animation.My 片段是

public class IconAnimation  extends Fragment implements OnClickListener {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
    Bundle savedInstanceState) 
{
    final View v = inflater.inflate(R.layout.icon_animation, container,false);  
    return v;
}
@Override
public void onClick(View v) {
    // TODO Auto-generated method stub
    switch (v.getId())
    {   
        case R.id.comedy:
            Animation animation1 AnimationUtils.loadAnimation(getActivity(), 
            R.anim.slide);
            ImageView image= (ImageView)v.findViewById(R.id.image);
            image.startAnimation(animation1);
            break;
    }
}
}

我的动画 XML 是

<?xml version="1.0" encoding="utf-8"?>
<set
 xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator"
android:fillAfter="true">
<translate
  android:fromXDelta="0%p"
  android:toXDelta="150%p"
  android:duration="800"
  />

它的输出是这样的:Output 但我想要这样的东西:expected outout

    final TranslateAnimation animationt1 = new TranslateAnimation(fromXoffset, toXOffset, fromYoffset,toYoffset);
    animationt1.setDuration(300);
    animationt1.setFillAfter(true);
    animationt1.setAnimationListener(this);
    yourView.startAnimation(animation1);

你也可以通过 XML :

 <?xml version="1.0" encoding="utf-8"?>
 <set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true"
android:interpolator="@android:anim/linear_interpolator" >
 <!-- Use startOffset to give delay between animations -->
<!-- Move -->
<translate
    android:duration="800"
    android:fillAfter="true"
    android:fromXDelta="0%p"
    android:startOffset="700"
    android:toXDelta="50%p" />
<translate
    android:duration="800"
    android:fillAfter="true"
    android:fromYDelta="0%p"
    android:startOffset="800"
    android:toYDelta="-10%p" />
 <translate
    android:duration="800"
    android:fillAfter="true"
    android:fromXDelta="0%p"
    android:startOffset="1300"
    android:toXDelta="75%p" />