I want to create an animation that the imageView will become more and more small and transparent, then disappear. I tried below code, it doesn’t work, when run it will grow from 0.01 size to the original size. I can’t figure out where the problem is.
Thank you very much!
[UIView animationWithDuration:2 animations:^{
[imageview setTransform:(CGAffineTransformMakeScale(0.01,0.01))];
[imageview setAlpha:0];
}
completion:^(BOOL finished){
[imageview removeFromSuperview];
}];
Try this code:
This will take in consider the existing imageView transform. (Is there a chance you already applied transform to this imageView?)
An other thing you can try is to add:
UIViewAnimationOptionBeginFromCurrentStateas an option to the animation method. You will have to use :