Iphone页面卷曲效果

Iphone页面卷曲效果,iphone,Iphone,我使用这段代码的页面卷曲效果…它的工作在模拟器和设备很好。。。但它不是(setType:@“pageCurl”)苹果公司记录的api,这导致它在应用商店审查过程中被iPhone开发者程序拒绝: animation = [CATransition animation]; [animation setDelegate:self]; [animation setDuration:1.0f]; animation.startProgress = 0.5; animation.endProgress

我使用这段代码的页面卷曲效果…它的工作在模拟器和设备很好。。。但它不是(setType:@“pageCurl”)苹果公司记录的api,这导致它在应用商店审查过程中被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中的地图应用程序那样中途停止它。。。这有什么解决办法吗?或者在iPodtouch中有没有苹果公司记录的卷曲页面效果的方法

我在找很多。但是没有得到任何答案?有人能帮我吗?
提前感谢..plz

必须使用“在点停止”页面卷曲效果吗?最简单的方法是用更简单的动画(例如,滑出)替换页面卷曲,或者只是将整个视图向上卷曲

您可能试图在运行时构造字符串来作弊,例如

[animation setType:[@"page" stringByAppendingString:@"Curl"]];
尽管你仍在使用未记录的方法。

如果可以的话

SampleViewController *sampleView = [[[SampleViewController alloc] init] autorelease];
[sampleView setModalTransitionStyle:UIModalTransitionStylePartialCurl];
[self presentModalViewController:sampleView animated:YES];

..

自SDK 3.2以来,部分卷曲已得到正式支持。检查Chris的示例代码。更多信息可以在常量下的UIViewController类参考中找到。

我找到了一个解决方案,可以使用动画块将UIView添加到UIViewController

m_容器是包含我的视图动画(self)的UIView。 自我是一种观点

注意:您需要导入QuartzCore

要使用页面卷曲动画显示视图,可以使用:

-(void)PresentView
{
    [UIView animateWithDuration:1.0 
                     animations:^{
                         CATransition *animation = [CATransition animation];
                         [animation setDelegate:self];
                         [animation setDuration:0.7];
                         [animation setTimingFunction:UIViewAnimationCurveEaseInOut];
                         animation.type = @"pageCurl";
                         animation.fillMode = kCAFillModeForwards;
                         animation.endProgress = 0.65;
                         [animation setRemovedOnCompletion:NO];
                         [m_container.layer addAnimation:animation forKey:@"pageCurlAnimation"];  
                         [m_container addSubview:self];
                         ;}  
     ];    
}
如果要隐藏此视图,可以使用:

-(void)HideHelpView
{
    [UIView animateWithDuration:1.0 
                     animations:^{
                         CATransition *animation = [CATransition animation];
                         [animation setDelegate:self];
                         [animation setDuration:0.7];
                         [animation setTimingFunction:UIViewAnimationCurveEaseInOut];
                         animation.type = @"pageUnCurl";
                         animation.fillMode = kCAFillModeForwards;
                         animation.startProgress = 0.35;
                         [animation setRemovedOnCompletion:NO];
                         [m_container.layer addAnimation:animation forKey:@"pageUnCurlAnimation"];  
                         [self removeFromSuperview];

                         ;}  
     ];

}

我想知道这是否会从裂缝中溜走……有人有这样做的经验吗?这似乎与地图的功能不同。也就是说,您可以将此转换应用于整个视图,但不能应用于子视图,因此可以离开工具栏。您好。所以你确实使用了@pagecurl类型,但应用程序被拒绝了?如果你想进行部分卷曲,但保持工具栏静止,就像在苹果的地图应用程序中一样,请查看我的解决方案。此代码不正确。CATTransition setTimingFunction:的参数类型为UIViewAnimationCurve,而不是CAMediaTimingFunction。使用名称为的CAMediaTimingFunction函数获取计时函数。