我正在使用这段代码实现页面翻页效果...在模拟器和设备上都可以正常工作...但是它并不是苹果文档中记录的API (setType:@"pageCurl"),因此在App Store审核过程中被iPhone开发者计划拒绝了。
animation = [CATransition animation];
[animation setDelegate:self];
[animation setDuration:1.0f];
animation.startProgress = 0.5;
animation.endProgress = 1;
[animation setTimingFunction:UIViewAnimationCurveEaseInOut];
[animation setType:@"pageCurl"];
[animation setSubtype:@"fromRight"];
[animation setRemovedOnCompletion:NO];
[animation setFillMode: @"extended"];
[animation setRemovedOnCompletion: NO];
[[imageView layer] addAnimation:animation
forKey:@"pageFlipAnimation"];
所以我进行了更改,并使用了以下方式。
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[UIView setAnimationDelegate:self];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
[UIView setAnimationWillStartSelector:@selector(transitionWillStart:finished:context:)];
[UIView setAnimationDidStopSelector:@selector(transitionDidStop:finished:context:)];
// other animation properties
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp
forView:imageView cache:YES];
// set view properties
[UIView commitAnimations];
在上面的代码中,我想要在页面翻页效果到一半时停止它。但是我不能像iPod上的地图应用程序那样在中途停止它。有没有任何解决方法?或者在iPod touch的页面翻页效果中使用了哪些苹果文档记录的方法?
我已经搜索了很多,但没有得到任何答案。有人可以帮帮我吗?谢谢提前。