上記のような画像のUIImageViewがあるので、画像の形状を徐々に小さくしたり大きくしたりする必要があります。
上記のタスクを実行するには、明らかにマスクを適用する必要があるため、丸みを帯びたCAShapeLayerを作成し、UIImageViewレイヤーに追加しました。半径を変更すると、その量の画像と半径のみが表示されます。
私の問題は、アニメーションを適用してアニメーション形式で表示する方法です。キーフレームアニメーションでは達成できないことを教えてください。
以下は、wrtradiusをマスキングするためのコードです。
// Set up the shape of the circle
int rChange = 0; // Its doing proper masking while changing this value
int radius = 123.5-rChange;
CAShapeLayer *circle = [CAShapeLayer layer];
// Make a circular shape
circle.path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0+rChange, 0+rChange, 2.0*radius, 2.0*radius)
cornerRadius:radius].CGPath;
// Configure the apperence of the circle
[circle setFillColor:[[UIColor blackColor] CGColor]];
[[self.originalImageView layer] setMask:circle];
self.originalImageView.layer.masksToBounds = YES;
ここで、123.5は画像の最大半径で、originalImageViewはmyUIImageViewです。