带有UIViewAnimationTransitionFlip的闪烁动画 [英] Flickering animation with UIViewAnimationTransitionFlip

查看:93
本文介绍了带有UIViewAnimationTransitionFlip的闪烁动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含2个子视图的containerview.我想从一个过渡到另一个.问题是出现某种闪烁.它不会在iPhone 3GS上发生,但会在Simulator和iPhone 3G上发生: http://www.hanspinckaers.com/upload/Flickering.png

I have a containerview with 2 subviews. I want to flip from one to another. The problem is that some kind of flickering appears. It doesn't happen on the iPhone 3GS, but on the Simulator and the iPhone 3G: http://www.hanspinckaers.com/upload/Flickering.png

有人知道为什么会这样吗?

Does anyone know why this happens?

这是代码:

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration: 0.75];
[UIView setAnimationDidStopSelector:@selector(afterAnimationProceed)];
[UIView setAnimationDelegate:self];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.containerView cache:YES];

if(self.mapViewController.view.superview){      
    [self.mapViewController.view removeFromSuperview];
    [self.containerView addSubview:self.tableController.view];
} else {
    [self.tableController.view removeFromSuperview];
    [self.containerView addSubview:self.mapViewController.view];
}


[UIView commitAnimations];

提前谢谢!

汉斯

推荐答案

当您进行2次以上单独的动画处理时,通常会发生fyi闪烁,请尝试将它们全部放入一个动画块中并提交组动画.

fyi flickering usually happens when you have 2+ seperate caanimations working, try to put them all into a single animation block and commit the groups animations.

这篇关于带有UIViewAnimationTransitionFlip的闪烁动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆