Iphone page curl effect

前端 未结 4 617
广开言路
广开言路 2020-12-23 15:46

I am using this code for Page curl effect ....Its work fine in simulator and device... But its not (setType:@\"pageCurl\") apple documented api , this caused it to be reject

相关标签:
4条回答
  • 2020-12-23 16:00

    Must the stop-at-mide-point page curl effect be used? The easiest method is to replace page curl by a simpler animation (e.g. slide-out), or just curl the whole view up.

    You may try to cheat by constructing the string at run time e.g.

    [animation setType:[@"page" stringByAppendingString:@"Curl"]];
    

    although you're still using an undocumented method.

    0 讨论(0)
  • 2020-12-23 16:05

    I found a solution to add an UIView to UIViewController using Animation block.

    m_Container is an UIView who contain my view animation (self). self is an UIView.

    CAUTION : You need to have import QuartzCore

    To present view with page curl animation you can use :

    -(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];
                             ;}  
         ];    
    }
    

    And when you want hide this view you can use :

    -(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];
    
                             ;}  
         ];
    
    }
    
    0 讨论(0)
  • 2020-12-23 16:11

    Partial curling is officially supported since SDK 3.2. Check the sample code of Chris. More information can be found in the UIViewController Class Reference under Constants.

    0 讨论(0)
  • 2020-12-23 16:20

    If I may?

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

    ......

    0 讨论(0)
提交回复
热议问题