ios缩小动画的问题!
我想做一个动画效果就是一个imageview逐渐缩小变透明,然后消失,但是我用了如下代码后发现imageview只会从0.01尺寸变大至原始尺寸,不会变小非常奇怪。请各位帮我指出问题所在,小弟感激不尽
[UIView animationWithDuration:2 animations:^{
[imageview setTransform:(CGAffineTransformMakeScale(0.01,0.01))];
[imageview setAlpha:0];
}
completion:^(BOOL finished){
[imageview removeFromSuperview];
}];
[解决办法]
使用CABasicAnimation 来创建动画效果。具体使用你再查一下。
[解决办法]
试了试好像没有问题
[解决办法]
试试代码:
[UIView animationWithDuration:2 animations:^{
CGAffineTransform *transform = CGAffineTransformScale(imageView.transform, 0.01, 0.01);
[imageview setTransform:transform];
[imageview setAlpha:0];
}
completion:^(BOOL finished){
[imageview removeFromSuperview];
}];
+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion{
}
[UIView animateWithDuration:2 animations:^{