0

我有一个带有 2 个子视图的容器视图。我想从一个翻转到另一个。问题是出现了某种闪烁。它不会在 iPhone 3GS 上发生,而是在 Simulator 和 iPhone 3G 上发生: http ://www.hanspinckaers.com/upload/Flickering.png

有谁知道为什么会这样?

这是代码:

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

提前致谢!

汉斯

4

2 回答 2

4

仅供参考,闪烁通常发生在您有 2 个以上的单独动画工作时,尝试将它们全部放入单个动画块并提交组动画。

于 2010-01-23T11:52:08.903 回答
0

我无法重现您的问题,但如果在转换开始时 tableview 或 mapview 正在滚动,我会遇到问题。

也许在转换之前禁用用户交互并停止任何滚动等会有所帮助?

除此之外,对不起!

山姆

于 2010-01-21T15:11:13.673 回答