1
提交翻转动画时出现奇怪的错误。这三个条显示出来,几乎就像没有被绘制的条。使用翻转动画时出现奇怪的图形故障
我有一张截图来展示我在说什么。这些线条总是在同一个地方,并在双方都显示出来。
graphics glitch screenshot http://img263.imageshack.us/img263/6079/animationglitch.jpg
这里是我正在使用的代码,我之前已经用它没有问题,所以我不知道什么布莱恩。
-(void)switchView
{
BOOL isChangingToMapView = _mapViewController.view.superview == nil;
CGContextRef context = UIGraphicsGetCurrentContext();
[UIView beginAnimations:nil context:context];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition:(isChangingToMapView ? UIViewAnimationTransitionFlipFromLeft : UIViewAnimationTransitionFlipFromRight) forView:self.view cache:YES];
if (isChangingToMapView)
{
[_mapViewController viewWillAppear:YES];
[_listViewController viewWillDisappear:YES];
[_listViewController.view removeFromSuperview];
[self.view insertSubview:_mapViewController.view atIndex:0];
[_listViewController viewDidDisappear:YES];
[_mapViewController viewDidAppear:YES];
}
else
{
[_listViewController viewWillAppear:YES];
[_mapViewController viewWillDisappear:YES];
[_mapViewController.view removeFromSuperview];
[self.view insertSubview:_listViewController.view atIndex:0];
[_mapViewController viewDidDisappear:YES];
[_listViewController viewDidAppear:YES];
}
[UIView commitAnimations];
}
任何有关可能导致此问题的想法?