我有一个 CALayer 的动画阴影路径:
CABasicAnimation* shadowAnimation = [CABasicAnimation animationWithKeyPath: @"shadowPath"];
shadowAnimation.duration = duration;
shadowAnimation.timingFunction = function;
shadowAnimation.fromValue = (id) panelView.layer.shadowPath;
panelView.layer.shadowPath = [UIBezierPath bezierPathWithRoundedRect: CGRectSetOriginM20 (panelView.bounds, CGPointZero) cornerRadius: cornerRadius].CGPath;
[panelView.layer addAnimation: shadowAnimation forKey: @"shadow"];
panelView.layer.shadowOpacity = 1.0;
我需要通过将 CALayer 的内容属性设置为 UIImage 来使用资产重新创建相同的效果。有没有办法让bounds
跟随的动画和阴影一样?