Flickering animation with UIViewAnimationTransitionFlip

我怕爱的太早我们不能终老 提交于 2020-02-23 06:48:10

问题


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?

This is the code:

[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];

Thanks in advance!

Hans


回答1:


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.




回答2:


I can't reproduce your problem but I do get issues if the tableview or mapview is scrolling when the transition starts.

Perhaps disabling user interaction and stopping any scrolling etc just before doing the transition will help?

Apart from that, sorry!

Sam



来源:https://stackoverflow.com/questions/2108972/flickering-animation-with-uiviewanimationtransitionflip

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!