1

我正在尝试在 imageview 中设置图像按顺序运行动画。每当我尝试重置图像以重新开始动画时,它都会延迟一点并且动画序列被破坏了任何解决这个问题的方法?

    @Override
protected void onStart() {
    // TODO Auto-generated method stub
    super.onStart();



    Bitmap bitmap1 = BitmapCompressor.getInstance().compressBitmap(
            photoPaths.remove(0), 250);
    apa1.setImageBitmap(bitmap1);

    apa1.startAnimation(view_1_anim_a);

    Bitmap bitmap2 = BitmapCompressor.getInstance().compressBitmap(
            photoPaths.remove(0), 250);
    apa2.setImageBitmap(bitmap2);

    apa2.startAnimation(view_2_anim_a);

    Bitmap bitmap3 = BitmapCompressor.getInstance().compressBitmap(
            photoPaths.remove(0), 250);
    apa3.setImageBitmap(bitmap3);

    apa3.startAnimation(view_3_anim_a);




    view_1_anim_a.setAnimationListener(new AnimationListener() {

        public void onAnimationStart(Animation animation) {
            // TODO Auto-generated method stub

        }

        public void onAnimationRepeat(Animation animation) {
            // TODO Auto-generated method stub

        }

        public void onAnimationEnd(Animation animation) {
            // TODO Auto-generated method stub

            apa1.startAnimation(view_1_anim_b);

        }
    });

    view_1_anim_b.setAnimationListener(new AnimationListener() {

        public void onAnimationStart(Animation animation) {
            // TODO Auto-generated method stub

        }

        public void onAnimationRepeat(Animation animation) {
            // TODO Auto-generated method stub

        }

        public void onAnimationEnd(Animation animation) {
            // TODO Auto-generated method stub
            apa1.startAnimation(view_1_anim_c);

        }
    });

    view_1_anim_c.setAnimationListener(new AnimationListener() {

        public void onAnimationStart(Animation animation) {
            // TODO Auto-generated method stub

        }

        public void onAnimationRepeat(Animation animation) {
            // TODO Auto-generated method stub

        }

        public void onAnimationEnd(Animation animation) {
            // TODO Auto-generated method stub

            apa1.startAnimation(view_1_anim_d);


        }
    });

    view_1_anim_d.setAnimationListener(new AnimationListener() {

        public void onAnimationStart(Animation animation) {


        }

        public void onAnimationRepeat(Animation animation) {
            // TODO Auto-generated method stub

        }

        public void onAnimationEnd(Animation animation) {
            Bitmap bitmap1 = BitmapCompressor.getInstance().compressBitmap(
                    photoPaths.remove(0), 250);
            apa4.setImageBitmap(bitmap1);

            apa4.startAnimation(view_1_anim_a)://HERE IT IS DELAYED A BIT AND THE SEQUENCE IS RUINED
        }
    });
4

0 回答 0