【发布时间】:2013-11-20 12:37:48
【问题描述】:
我有一个带有
的UIView 动画
[UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)]
由于某种原因,animationDidStop:finished:context: 在动画结束之前被调用。
有任何想法吗? (在iOS7模拟器上测试)
代码:
-(void)checkForAndRemoveTable {
//The animation should fade to 0 then remove itself from it's superview at the end.
if (tableViewController.view.superview != nil) {
[UIView beginAnimations:@"dismissTable" context:NULL];
[UIView setAnimationDuration:0.5];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
tableViewController.view.alpha = 0;
[UIView commitAnimations];
}
}
-(void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
if ([animationID isEqualToString:@"dismissTable"]) {
[tableViewController.view removeFromSuperview];
}
}
【问题讨论】:
标签: ios iphone ipad animation uiview