我有一个图像数组加载到UIImageView中,我通过一个循环动画.显示图像后,我想@selector调用一个以关闭当前视图控制器.使用以下代码可以很好地动画图像:
NSArray * imageArray = [[NSArray alloc] initWithObjects:
[UIImage imageNamed:@"HowTo1.png"],
[UIImage imageNamed:@"HowTo2.png"],
nil];
UIImageView * instructions = [[UIImageView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
instructions.animationImages = imageArray;
[imageArray release];
instructions.animationDuration = 16.0;
instructions.animationRepeatCount = 1;
instructions.contentMode = UIViewContentModeBottomLeft;
[instructions startAnimating];
[self.view addSubview:instructions];
[instructions release];
Run Code Online (Sandbox Code Playgroud)
16秒后,我想要一个方法来调用.我查看了UIView类方法,setAnimationDidStopSelector:但我无法使用它来处理当前的动画实现.有什么建议?
谢谢.