怎么实现 UIImageView用一张图片,从指定位置逐渐变大,最后停止的动画
// 参数1 完成动画的时间
// 参数2 要完成的动画
// 参数3 该block 写 动画结束后要干的事
UIView animateWithDuration:@"参数1" animations:
@"参数2" completion:^(BOOL finished)completion
首先给一个UIImageView初始位置 高是0添加图片 在动画中更改UIImageView的高就行了 希望能帮到你
UIView animation with duration...那个方法可以
和你的控件类型无关,用uiview 的animation
UIView animation
UIView animateWithDuration
CABasicAnimation *animation=[CABasicAnimation animationWithKeyPath:@"transform.scale"];
animation.toValue = @2.0f; //放大倍数
animation.duration = 0.5f;//动画时间
animation.autoreverses = NO;
//不还原初始状态
animation.removedOnCompletion = NO;
animation.fillMode = kCAFillModeForwards;
[self.button.layer addAnimation:animation forKey:@"scale"];