1
我有一個的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
跟隨陰影一樣的動畫?