我正在设置以下
重复动画中是否会调用
UIView animateWithDuration:
方法,以便在程序的其他地方设置我的 animationOn
BOOL 以取消该无限循环重复。 我一直认为每次动画循环结束时都会调用 completion
块,但事实并非如此。重复动画中是否会调用
completion
块? 如果不是,那么我是否有另一种方法可以在此方法之外停止此动画?- (void) animateFirst: (UIButton *) button
{
button.transform = CGAffineTransformMakeScale(1.1, 1.1);
[UIView animateWithDuration: 0.4
delay: 0.0
options: UIViewAnimationOptionCurveEaseOut | UIViewAnimationOptionAutoreverse | UIViewAnimationOptionRepeat
animations: ^{
button.transform = CGAffineTransformIdentity;
} completion: ^(BOOL finished){
if (!animationOn) {
[UIView setAnimationRepeatCount: 0];
}
}];
}
.transform
设置为CGAffineTransformMakeScale(1.0,1.0)
)。 - Luke