我的情况:我有一个UIButton
动画,它CAKeyframeAnimation
被声明为一个类别UIView
:
CAKeyframeAnimation * scale = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
scale.duration = duration;
scale.beginTime = delay;
scale.fillMode = kCAFillModeForwards;
NSMutableArray * times = [[NSMutableArray alloc] init];
scale.values = values;
scale.timingFunctions = times;
CAAnimationGroup * group = [CAAnimationGroup animation];
[group setDelegate:self];
[group setDuration:duration + delay];
[group setFillMode:kCAFillModeForwards];
[group setRemovedOnCompletion:NO];
[group setAnimations:[NSArray arrayWithObject:scale]];
[self.layer addAnimation:group forKey:@"scale"];
问题是在动画之后,按钮没有收到触摸。如果我删除动画一切正常。有谁知道我做错了什么?
谢谢