我想实现,动画的连续性,是这样的:
一个控件,首先左右抖,然后向上一边透明一边向上升,就像火箭
开始发动一样我现在想到的是向上一边透明一边向上升的话,一个set在里面加个透明和移动就行了,
但是分开两个步骤,我就不会了,因为我只知道设置setAnimation(),只能设置一个动画,
现在我要实现的不只是一个动画,是连续的两个动画,左右抖和向上升,该怎么弄??
如果是单纯连续性用两个setAnimation的效果,貌似不行你们是怎么实现的??
这段时间,大多东西塞进大脑了,什么都想不到,烦到透,不知道是不是新知识太多了,
大脑都缺氧了,大侠们都指教一下吧 之前看到别人是说在animation结束之后,再放一个动画,但是,我觉得这并不是一个好方法,
问下大家还有其它的方法吗??

解决方案 »

  1.   

    在监听finish的时候 继续再动画
      

  2.   

    public void setAnimationListener (Animation.AnimationListener listener)Added in API level 1
    Binds an animation listener to this animation. The animation listener is notified of animation events such as the end of the animation or the repetition of the animation.
      

  3.   

    2个动画完全可以啊   怎么不行了   就像LS上说的嘛  监听结束或者如果动画的整个占用空间不大的话  做成逐帧动画呗再或者  你设置抖动动画的时间(duration,设置为个0.5s的样子)  设置你的透明和移动动画为1s以上  
    加个加速器   那个先缓慢变化再快速变化的加速器    不过效果可能会有点折扣
      

  4.   

    其实不是2个动画的,只是随便输入一个数据而已

    我擦  需求变化斩真快  
    高兴啊,高兴,成功了~~~
    public class LogoActivity extends Activity implements AnimationListener{
    private ImageView logoImage = null;
    private Animation animation = null;
    private HashMap<String, Button> buttons = new HashMap<String, Button>();
    private int index = 1; protected void onCreate(Bundle savedInstanceState) {


    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_logo); /*启动logo画面*/
    logoImage = (ImageView)this.findViewById(R.id.logoID);
    animation = AnimationUtils.loadAnimation(this, R.anim.logo_one);

    logoImage.startAnimation(animation);
    animation.setAnimationListener(this);
    }
    public void onAnimationEnd(Animation animation) {
    switch (index){
    case 1://第一个动画
    {
    index++;
    animation = AnimationUtils.loadAnimation(this, R.anim.logo_one);
    logoImage.startAnimation(animation);
    animation.setAnimationListener(this);

    }break; case 2://第二个动画
    {
    index++;
    animation = AnimationUtils.loadAnimation(this, R.anim.logo_two);
    logoImage.startAnimation(animation);
    animation.setAnimationListener(this);

    }break; case 3://第三个动画
    {
    index++;
    animation = AnimationUtils.loadAnimation(this, R.anim.logo_three);
    logoImage.startAnimation(animation);
    animation.setAnimationListener(this);

    }break; case 4://第四个动画
    {
    index = 1;
    animation = AnimationUtils.loadAnimation(this, R.anim.logo_four);
    logoImage.startAnimation(animation);
    animation.setAnimationListener(this);

    }break; default:break;
    }
    }}
    顺便讨教下,能不能再精简点,指导下一两点??谢谢爱学习
      

  5.   

     index++;
                animation = AnimationUtils.loadAnimation(this, R.anim.logo_one);    
     
                 
                logoImage.startAnimation(animation);        
                animation.setAnimationListener(this);封装一下这些操作
      

  6.   

    这个代码还行啊  精简的话  就像LS说的  传递index过去  用一个方法来构造动画
      

  7.   

    为什么不能在一个xml配好 用时间标识动作开始和结束呢?
      

  8.   

    AnimationSet貌似可以,可以设置多个动画,控制每个动画显示的顺序以及时间。