zoukankan      html  css  js  c++  java
  • UINavigationController改变动画效果

    @interface UINavigationController (CustomTransition)
    
    - (void) pushWithCustomAnimation:(UIViewController *) controller;
    - (void) popWithCustomAnimation;
    @end
    @implementation UINavigationController (CustomTransition)
    
    - (void) pushWithCustomAnimation:(UIViewController *) controller {
        CATransition *transition = [CATransition animation];
        transition.duration = 0.3;
        transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
        transition.type = kCATransitionMoveIn;
        transition.subtype = kCATransitionFromTop;
        transition.delegate = self;
        [self.view.layer addAnimation:transition forKey:nil];
        self.navigationBarHidden = NO;
        [self pushViewController:controller animated:NO];
    
    }
    
    - (void) popWithCustomAnimation {
        CATransition *transition = [CATransition animation];
        transition.duration =0.3;
        transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
        transition.type = kCATransitionReveal;
        transition.subtype = kCATransitionFromBottom;
        transition.delegate = self;
        [self.view.layer addAnimation:transition forKey:nil];
        
        self.navigationBarHidden = NO;
        [self popViewControllerAnimated:NO];
    
    }
    
    @end
  • 相关阅读:
    存储结构接收数组
    oracle数据库sql根据查看执行计划优化sql--走不走索引
    多线程--Thread
    java常用集合族谱
    设计模式之二 适配模式
    Tomcat优化问题
    设计模式之一
    C++虚函数表,虚表指针,内存分布
    设计模式
    linux环境下的时间编程
  • 原文地址:https://www.cnblogs.com/benbenzhu/p/3930909.html
Copyright © 2011-2022 走看看