【发布时间】:2012-09-03 02:12:14
【问题描述】:
这是我的代码:
CABasicAnimation *animation = [CABasicAnimation
animationWithKeyPath:@"transform.scale"];
[animation setFromValue:[NSNumber numberWithFloat:1.0f]];
[animation setToValue:[NSNumber numberWithFloat:3.0f]];
[animation setDuration:0.8];
[animation setRemovedOnCompletion:NO];
[animation setFillMode:kCAFillModeForwards];
[imageView.layer addAnimation:animation forKey:@"scale"];
[imageView setFrame:nowRect];
我发现这不对,因为当我将imageView框架设置为nowRect时,imageView的层又变大了!
【问题讨论】:
-
嗨,您的实际需求是什么......
-
嗨,对不起,我的英语太差了。我想让 imageview 的 frame 成为 imageview 的图层在动画后显示的帧。
-
你之前和之后的帧大小是多少......
-
比如老框架是(x,y,width,height)。新框架是(x,y,宽度*3,高度*3)。动画后,我想将imageview的框架设置为与其图层的框架相同。
标签: iphone imageview scale layer cabasicanimation