0
我的animationDidStop方法没有被调用,出于某种原因,最初我以为是因为代理没有设置,但补救说,我仍然有同样的问题。有任何想法吗?在此先感谢:)AnimationDidStop不被称为
- (void)hideInterfaceButtonClicked : (id) sender
{
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(animationDidStop)];
[UIView beginAnimations:@"MoveView" context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
[UIView setAnimationDuration:0.5];
// Move to the right
CGAffineTransform translateInterface = CGAffineTransformMakeTranslation(454,288);
// Scale
CGAffineTransform scale = CGAffineTransformMakeScale(0.20,0.20);
// Apply them to the view
self.transform = CGAffineTransformConcat(scale, translateInterface);
self.alpha = 0.0;
[UIView commitAnimations];
}
- (void)animationDidStop {
NSLog(@"Animation Has Stopped");
[[NSNotificationCenter defaultCenter] postNotificationName:@"hiddenInteraceViewNeeded" object:self]; //after MoveView finishes
}
尝试移动'setAnimationDelegate'和''setAnimationDidStopSelector' ... beginAnimations'不知道这是否会帮助和目前无法测试,但这将是第一次尝试... – 2012-04-02 15:21:36