【发布时间】:2015-02-03 11:51:28
【问题描述】:
我的 UIViewController 中有一个 UIImageView。我在上面设置了一个图像。我做了如下轮换。
- (void) runSpinAnimationOnView:(UIImageView*)view duration:(CGFloat)duration rotations:(CGFloat)rotations repeat:(float)repeat
{
CABasicAnimation* rotationAnimation;
rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 2.0 /* full rotation*/ * rotations * duration ];
rotationAnimation.duration = duration;
rotationAnimation.cumulative = YES;
rotationAnimation.repeatCount = repeat;
[view.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];
}
我称之为
[self runSpinAnimationOnView:_imageView duration:1.0 rotations:360 repeat:1.0];
现在我还想调整相同图像视图的大小,但各方面的比例相同,我该怎么做。
简单地说,我想旋转 UIImageView 并同时调整它的大小。
谢谢
【问题讨论】:
标签: ios objective-c uiimageview autoresize autorotate