0
我有一个圆形图像,我想纵向“挤压”,使其看起来更像一条水平线,然后将其展开回原始形状。我认为这将通过该层的锚点设置为中心,然后动画经由UIViewAnimation帧与帧的高度工作= 1iOS - 垂直挤压图像
[self.imageToSquish.layer setAnchorPoint:CGPointMake(0.5, 0.5)];
CGRect newFrame = CGRectMake(self.imageToSquish.frame.origin.x, self.imageToSquish.frame.origin.y, self.imageToSquish.frame.size.width, 1);
[UIView animateWithDuration:3
animations:^{self.imageToSquish.frame = newFrame;}
completion:nil];
但图像朝向顶部而不是围绕中心收缩。
是的,CGAffineTransform效果更好。谢谢。 – soleil 2012-02-03 00:06:19