zoukankan      html  css  js  c++  java
  • pushViewController自定义动画

    实现的主要代码如下:

    CATransition *transition = [CATransition animation];  

    transition.duration = 1.0f;  

    transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];  

    transition.type = @"cube";  

    transition.subtype = kCATransitionFromRight;  

    transition.delegate = self;  

    [self.navigationController.view.layer addAnimation:transition forKey:nil];  

    FirstViewController *firstViewController = [[DemoViewController alloc]init];  

    [self.navigationController pushViewController: firstViewController animated:YES];   


    其中的动画类型有:

    1. animation.type = kCATransitionFade;    
    2. animation.type = kCATransitionPush;   
    3. animation.type = kCATransitionReveal;  
    4. animation.type = kCATransitionMoveIn;  
    5. animation.type = @"cube";  
    6. animation.type = @"suckEffect";  
    7. animation.type = @"oglFlip";  // 页面旋转
    8. animation.type = @"rippleEffect"; //水波纹
    9. animation.type = @"pageCurl";  
    10. animation.type = @"pageUnCurl";  
    11. animation.type = @"cameraIrisHollowOpen";  
    12. animation.type = @"cameraIrisHollowClose";  

    返回按钮的动画实现事件

      1. // 修改导航栏的 左边的标题  
      2. self.navigationItem.leftBarButtonItem=[[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIButtonTypeRoundedRect target:self action:@selector(back)];  
  • 相关阅读:
    ajax_基础1
    省市数据库脚本TblArea.
    c#中怎么使用dos命
    Lambda表达式
    面试收录
    .Net牛逼程序猿要懂得
    Web.config 配置文件
    sql 查询所有数据库、表名、表字段总结
    Json在net与页面之间的传递
    『转』SAP统驭科目解释
  • 原文地址:https://www.cnblogs.com/56ik/p/5134513.html
Copyright © 2011-2022 走看看