首页 > Web开发 > 详细

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

时间:2015-04-23 12:58:01      阅读:296      评论:0      收藏:0      [点我收藏+]
 本文转载至  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)];  

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

原文:http://www.cnblogs.com/Camier-myNiuer/p/4449837.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!