pushViewController自定义动画http://blog.csdn.net/ralbatr/article/details/22039233

 本文转载至  http://blog.csdn.net/ralbatr/article/details/22039233
实现的主要代码如下:

 

  1. CATransition *transition = [CATransition animation];  
  2. transition.duration = 1.0f;  
  3. transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];  
  4. transition.type = @"cube";  
  5. transition.subtype = kCATransitionFromRight;  
  6. transition.delegate = self;  
  7. [self.navigationController.view.layer addAnimation:transition forKey:nil];  
  8.   
  9. FirstViewController *firstViewController = [[DemoViewController alloc]init];  
  10. [self.navigationController pushViewController: firstViewController animated:YES];   

其中的动画类型有:

 

 

  1. animation.type = kCATransitionFade;  
  2.   
  3. animation.type = kCATransitionPush;  
  4.   
  5. animation.type = kCATransitionReveal;  
  6.   
  7. animation.type = kCATransitionMoveIn;  
  8.   
  9. animation.type = @"cube";  
  10.   
  11. animation.type = @"suckEffect";  
  12.   
  13. // 页面旋转  
  14. animation.type = @"oglFlip";  
  15.   
  16. //水波纹  
  17. animation.type = @"rippleEffect";  
  18.   
  19. animation.type = @"pageCurl";  
  20.   
  21. animation.type = @"pageUnCurl";  
  22.   
  23. animation.type = @"cameraIrisHollowOpen";  
  24.   
  25. animation.type = @"cameraIrisHollowClose";  

返回按钮的动画实现事件

 

  1. // 修改导航栏的 左边的标题  
  2. self.navigationItem.leftBarButtonItem=[[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIButtonTypeRoundedRect target:self action:@selector(back)];  
posted @ 2015-04-23 11:11  天牛  阅读(215)  评论(0)    收藏  举报