如何在第一个动画结束之前开始第二个动画?

第一个动画持续时间15秒,在第六秒的时候播放第二个动画,
第二个动画持续时间8秒,如何做到?谢谢!

程序样本:

// 动画1
-(void)animation1:(UIImageView *)image1

// set up the animation
;
;
;
;

// The transform matrix
CGAffineTransform transform1 = 

CGAffineTransformMakeRotation(1);
image1.transform = transform1;
;

}

// 动画2
-(void)animation2:(UIImageView *)image2

// set up the animation
;
;
;
;

// The transform matrix
CGAffineTransform transform2 = 

CGAffineTransformMakeRotation(2);
image2.transform = transform2;
;

}

// 调用函数
-(void)loadview{

image1 = initWithImage:[UIImage

imageNamed:@“image1.png”]];
;
;
;

// 我希望第二个动画延迟 6 秒开始
image2 = initWithImage:[UIImage

imageNamed:@“image2.png”]];
;
;
;

}

以上的代码两个动画总是同时运行。

搜一下animation group

在哪里搜? 能直接给答案吗老弟?

http://www.cocoachina.com/bbs/simple/index.php?t21047.html
参考一下,这种解决方案我认为是最好的,用timer或者performSelector我认为不是

http://www.cocoachina.com/bbs/simple/index.php?t21047.html
参考一下,这种解决方案我认为是最好的,用timer或者performSelector我认为不是
很好

http://www.cocoachina.com/bbs/simple/index.php?t21047.html
看了。每看懂。不知道哪几行程序是关键。

在第二个动作最开始加个延时什么的应该能行。

不行啊。我试过了。
如果加了一行:

结果是先等6秒后,两个动画同时开始。

我想应该是用这个函数+ (void)setAnimationDelay:(NSTimeInterval)delay;

不行啊。我试过了。结果还是先等6秒后,两个动画同时开始。
// 动画2
-(void)animation2:(UIImageView *)image2

// set up the animation
;
;
;
UIView setAnimationCurve:UIViewAnimationCurveEa

对不起,弄错了。结果是图片image2先出现, 然后等了6秒后才开始动。还是很感谢。

试试

多谢。开始程序总是退出,后来搜索了一下发现要加个冒号才行。