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
  • 相关阅读:
    python文件、文件夹操作OS模块
    python字符串
    python集合set
    多市场交易碎片交易
    基金公司主要系统
    高频交易:Solarflare组建超低延迟网络
    上交所技术前沿
    高频交易低延迟:信鸽、100微妙和恒生的纳秒试验
    解密PB
    解密HOMS
  • 原文地址:https://www.cnblogs.com/benbenzhu/p/3930909.html
Copyright © 2011-2022 走看看