我有动画的代码:
facebookImage.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"Animation01.png"],
[UIImage imageNamed:@"Animation02.png"],
[UIImage imageNamed:@"Animation03.png"],
[UIImage imageNamed:@"Animation04.png"],
[UIImage imageNamed:@"Animation05.png"],
nil];
facebookImage.animationDuration = 1.3;
facebookImage.animationRepeatCount = 1;
[facebookImage startAnimating];
如何在完成此动画后使用委托回调(或其他内容)来执行某些操作?
我不能这样做:
[UIView setAnimationDelegate:self];
因为我在UIImageview
谢谢:)
答案 0 :(得分:0)
只需添加如下:
float animationDuration = 1.3;
facebookImage.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"Animation01.png"],
[UIImage imageNamed:@"Animation02.png"],
[UIImage imageNamed:@"Animation03.png"],
[UIImage imageNamed:@"Animation04.png"],
[UIImage imageNamed:@"Animation05.png"],
nil];
facebookImage.animationDuration = animationDuration;
facebookImage.animationRepeatCount = 1;
[facebookImage startAnimating];
[self performSelector:@selector(someMethodDelayedToEndOfAnimation) withObject:nil afterDelay: animationDuration];