I would like to animate the change of an image to another from a UIImageView with:
[UIView transitionWithView:self.scrollView
duration:1
options:UIViewAnimationOptionTransitionCrossDissolve | UIViewAnimationOptionAllowUserInteraction
animations:^
{
self.imageView.image = image;
} completion:nil];
which works perfectly fine for one animation. But if I have one or more animations starting while the first one is still in progress I get some wired behavior it looks like some sort of jumps or flickering. If I use slow animations in the simulator it seems the first animation is stopped and jumps right to the end image of the first animation and starts then with the second one. Does anyone have an idea how to prevent this to happen?
Try to tell the animation that it should begin from the current state. (UIViewAnimationOptionBeginFromCurrentState)
[UIView transitionWithView:self.imageView
duration:1
options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionTransitionCrossDissolve | UIViewAnimationOptionAllowUserInteraction
animations:^
{
self.imageView.image = image;
} completion:nil];
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