我想要做的是模拟我的按钮周围的脉冲。我可以获得发光效果来改变按钮图层的属性。但是,我无法让它动画化。这是我到目前为止所尝试的:
UIColor *confirmButtonColor = self.btnConfirm.currentTitleColor;
self.btnConfirm.layer.shadowOffset = CGSizeZero;
self.btnConfirm.layer.masksToBounds = NO;
self.btnConfirm.layer.shadowColor = confirmButtonColor.CGColor;
self.btnConfirm.layer.shadowRadius = 6.0f;
self.btnConfirm.layer.shadowOpacity = .0f;
[UIView animateWithDuration:1.2 delay:5 options:UIViewAnimationCurveLinear animations:^{
self.btnConfirm.layer.shadowOpacity = 1.0f;
}completion:nil];
辉光出现时没有动画;我还尝试将所有代码放入动画中并且没有更改。是的,我导入Quartz
.
谢谢