我有一个自定义视图。这个自定义视图有两个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