首页 > 其他 > 详细

UINavigationController改变动画效果

时间:2014-08-23 13:50:20      阅读:284      评论:0      收藏:0      [点我收藏+]
@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

 

UINavigationController改变动画效果

原文:http://www.cnblogs.com/benbenzhu/p/3930909.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!