我有一個自定義視圖。這個自定義視圖有兩個UIImageViews - imageview1和imageview2。翻轉動畫不起作用
[UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:2.00]; [UIView setAnimationDelegate:self]; [UIView setAnimationDidStopSelector:@selector(transitionDidStop:finished:context :)]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self cache:YES];如果(frontVisible){ [imageview1 removeFromSuperview]; [self addSubview:imageview2]; } else { [imageview2 removeFromSuperview]; [self addSubview:imageview1]; } frontVisible =!frontVisible; [UIView commitAnimations];
圖像從imageview1更改爲imageview2和viceversa但我沒有得到翻轉效果。相反,當另一個圖像出現時,我會看到一個圖像漸漸消失。
你正在測試設備或模擬器? – nduplessis 2009-09-11 09:34:07
我在模擬器上測試 – Minar 2009-09-11 10:06:27