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];
}
任何有關可能導致此問題的想法?