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

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

 

[objc]  view plain copy print ? 在CODE上查看代码片 派生到我的代码片
 
  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];   

其中的动画类型有:

 

 

[objc]  view plain copy print ? 在CODE上查看代码片 派生到我的代码片
 
  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";  

返回按钮的动画实现事件

 

[objc]  view plain copy print ? 在CODE上查看代码片 派生到我的代码片
 
  1. // 修改导航栏的 左边的标题  
  2. self.navigationItem.leftBarButtonItem=[[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIButtonTypeRoundedRect target:self action:@selector(back)];  

转载于:https://www.cnblogs.com/Camier-myNiuer/p/4449837.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值