Changing the animation for UINavigationController NavigationBar

后端 未结 1 1876
独厮守ぢ
独厮守ぢ 2020-12-28 10:53

Right now when I use [self.navigationController setNavigationBarHidden:NO animated:YES];

The navigation bar flies in from right to left, is there a way to drop it do

相关标签:
1条回答
  • 2020-12-28 11:28

    Give this a go:

    CATransition *transition = [CATransition animation];
    transition.duration = kAnimationDuration;
    transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
    transition.type = kCATransitionPush;
    transition.subtype = kCATransitionFromTop;
    transition.delegate = self;
    [self.navigationController.view.layer addAnimation:transition forKey:nil];
    
    self.navigationController.navigationBarHidden = NO;
    [self.navigationController pushViewController:tableViewController animated:YES];
    

    Worked great for me.

    Source: http://www.iphonedevsdk.com/forum/iphone-sdk-development/25045-navigation-controller-custom-animation.html

    0 讨论(0)
提交回复
热议问题