I am having trouble animating scale of a view to zero. Here's my code:
[UIView animateWithDuration:0.3 animations:^{
myView.transform = CGAffineTransformMakeScale(0.0, 0.0);
} completion:^(BOOL finished){
}];
For some reason, the view stretches and squeezes horizontally like old TV tube switching off. If I make the scale to (0.1, 0.1)
instead, it scales properly, but of course, not til zero.
Why is this happening?
If someone is still interested, here's what I did (in Swift) to make it work (almost):
UIView.animate(withDuration: 1) {
myView.transform = CGAffineTransform(scaleX: 0.01, y: 0.01)
}
If the duration is short, you don't get to see that is doesn't scale exactly to 0 and it effectively fades.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With