【发布时间】:2012-03-06 04:44:45
【问题描述】:
我将一组图像加载到 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];
16 秒后,我想调用一个方法。我查看了UIView 类方法setAnimationDidStopSelector:,但我无法让它与我当前的动画实现一起工作。有什么建议吗?
谢谢。
【问题讨论】:
标签: iphone objective-c animation uiview uiimageview