代码之家  ›  专栏  ›  技术社区  ›  rson

部分页面卷曲动画

  •  12
  • rson  · 技术社区  · 17 年前

    UIViewAnimationTransitionCurlUp

    4 回复  |  直到 17 年前
        1
  •  1
  •   Sixten Otto    17 年前

    UIViewController UIModalTransitionStyle UIModalTransitionStylePartialCurl .从 reference

    typedef enum {
      UIModalTransitionStyleCoverVertical = 0,
      UIModalTransitionStyleFlipHorizontal,
      UIModalTransitionStyleCrossDissolve,
      UIModalTransitionStylePartialCurl,
    } UIModalTransitionStyle;
    

    UIViewController *viewController;
    // …create or retrieve your view controller…
    
    // Note: The modalPresentationStyle must be UIModalPresentationFullScreen,
    //       and the presenter must also be a full-screen view
    viewController.modalPresentationStyle = UIModalPresentationFullScreen;
    viewController.modalTransitionStyle = UIModalTransitionStylePartialCurl;
    
        2
  •  11
  •   tJener    15 年前

    -(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];
    
                             ;}  
         ];
    
    }
    
        3
  •  7
  •   halfer Jatin Pandey    7 年前

    Maps部分旋度是一个私有的API。你可以在Erica Sadun的书中找到如何使用它的详细信息 The iPhone Developer's Cookbook

        4
  •  0
  •   Frank Schmitt    17 年前

    +setAnimationRepeatCount:

    推荐文章