0
我有一個UIImageView,它從正方形動畫來圈與此代碼:動畫的CALayer陰影圓圈(或圓角)
CABasicAnimation *circleShapeAnimation = [CABasicAnimation animationWithKeyPath:@"cornerRadius"];
circleShapeAnimation.fromValue = [NSNumber numberWithFloat:0.0f];
circleShapeAnimation.toValue = [NSNumber numberWithFloat:cornerRadius];
我也有一個單獨的的UIView(其的backgroundColor是clearColor),我專門用來實現動畫陰影。動畫一切正常,除了形狀動畫:
CABasicAnimation* shadowShapeAnimation = [CABasicAnimation animationWithKeyPath: @"shadowPath"];
shadowShapeAnimation.fromValue = (id)[UIBezierPath bezierPathWithRoundedRect: cell.placeImage.bounds cornerRadius:0.0f].CGPath;
shadowShapeAnimation.toValue = (id)[UIBezierPath bezierPathWithRoundedRect: cell.placeImage.bounds cornerRadius:cornerRadius].CGPath;
其中,簡單地說,看起來比我早上宿醉醜陋。
我想實現圓角的一個不錯的,流暢的動畫效果。任何想法如何?