我想在UIImageview中做一个缩放动画,但是我收到了一个意想不到的行为
问题描述:
我想用UIImageview
做一个缩放动画,但是当使用这个动画块时,图像视图会在动画之前稍稍移动。代码我使用:我想在UIImageview中做一个缩放动画,但是我收到了一个意想不到的行为
[UIView animateWithDuration:1.0
delay:0
options:UIViewAnimationOptionBeginFromCurrentState
animations:(void (^)(void)) ^{
imgLogoImage.transform=CGAffineTransformMakeScale(1.03, 1.03);
}
completion:^(BOOL finished){
imgLogoImage.transform=CGAffineTransformIdentity;
}];
答
也许这是由您的比例因子太小引起的,特别是当经缩放的大小为相对长的时间(1秒)相对较小。
可能的重复[如何正确缩放UIImageViewView与UIView animateWithDuration?](http://stackoverflow.com/questions/7081076/how-to-scale-uiimageview-properly-with-uiview-animatewithduration) – Shai