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)];  
  • 相关阅读:
    sql server 行转列
    java 加密解密WORD文档
    数据库重新连接存储
    MSSQL 删除索引
    WORD添加批注(JAVA)
    JAVA添加WORD文档批注
    MYECLIPSE说明书
    K3二次开发后台表
    css css预处理器
    javascript 视频播放指定的时间段
  • 原文地址:https://www.cnblogs.com/56ik/p/5134513.html
Copyright © 2011-2022 走看看