Question

I'm making transitions for views on my iOS app.

I'm using this way

   [UIView transitionWithView:self.view duration:0.5
                     options:UIViewAnimationOptionTransitionFlipFromRight
                     animations:^ { [self.view addSubview:mapa.view]; }
                     completion:nil];

It works fine, but with certain views it cause glitches.

For example, I have a view with 2 pages at UIScrollView, during animation it looks like both pages has been merged and on animation finish it change to look right.

I have a lot of views with UITableView background color set to alpha, during animations it changes to white color without alpha.

Is there some way to fix this or its a known problem?

Maybe iOS is doing it for better GPU performance?

Was it helpful?

Solution

You should use UIViewAnimationOptionAllowAnimatedContent, otherwise the animation is generated with a snapshot (often ignoring alphas)

Animate the views by changing the property values dynamically and redrawing the view. If this key is not present, the views are animated using a snapshot image.

Your code would look like this:

[UIView transitionWithView:self.view duration:0.5
                 options:(UIViewAnimationOptionTransitionFlipFromRight|UIViewAnimationOptionAllowAnimatedContent)
                 animations:^ { [self.view addSubview:mapa.view]; }
                 completion:nil];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top