• 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)];  
  • 相关阅读:
    十五。JAVA方法的分类
    八。java数组
    十三。第三章实例
    十二。工具类中算法的实现
    九。求JAVA最大,最小,平均值
    十四。JAVA类的认识
    十一。查找
    Listview中使用线程实现无限加载更多项目的功能
    PL/SQL Developer的常用技巧
    android异步加载图片
  • 原文地址:https://www.cnblogs.com/56ik/p/5134513.html
Copyright © 2020-2023  润新知