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;
其中,简单地说,看起来比我早上宿醉丑陋。
我想实现圆角的一个不错的,流畅的动画效果。任何想法如何?