Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 285471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:32:58+00:00 2026-05-12T05:32:58+00:00

I would like to have the navigation bar hide more slowly than usual. I

  • 0

I would like to have the navigation bar hide more slowly than usual.

I tried the following, but when hiding, it disappears instantly instead of animating out (the view below does animate up correctly):

[UIView beginAnimations:@"hideNavBar" context:nil];
[UIView setAnimationDuration:2.0];
[self.navigationController setNavigationBarHidden:value];
[UIView commitAnimations];

If I substitute:

[self.navigationController setNavigationBarHidden:value animated:YES];

Then it uses the usual duration instead of my slow version. Hmmph.

I even tried to get really crafty and do:

CGFloat *durationRef = &UINavigationControllerHideShowBarDuration;
CGFloat oldDuration = *durationRef;
*durationRef = 2.0;
[self.navigationController setNavigationBarHidden:value animated:YES];
*durationRef = oldDuration;

Which resulted in a EXE _ BAD _ ACCESS on the assignment. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T05:32:58+00:00Added an answer on May 12, 2026 at 5:32 am

    If you want to change the duration you need to implementation your own. UINavigationBar is a view, you can grab its layer and move it around without the actual view. Basically you do something like this:

    //This routine starts animating the layer of the navigation bar off screen
    - (void)hideNavigationBar {
      CALayer *layer = self.navigationBar.layer;
    
      CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform"];
      animation.duration = 4.0;
      animation.toValue = [NSNumber numberWithFloatValue:(layer.position.y - self.navigationBar.frame.size.height)];
      animation.delegate = self;
      [touchedLayer addAnimation:animation forKey:@"slowHide"];
    }
    
    //This is called when the animation completes. We have not yet actally
    //hidden the bar, so on redraw it will snap back into blace. We hide it
    //here before the redraw happens.
    - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL) finished {
      if (finished) {
        [self.navigationController setNavigationBarHidden:YES animated:NO];
      }
    }
    

    Animating the bar back in is similiar. Note that this will not scale any other views on screen as the bar moves, you will have to setup seperate animations on whatever other views need to adjust.

    Changing the speed is a lot of work, UIKit is not setup to do it, and working around Apple’s built in animations is like walking through landmines. Unless you have a really compelling reason to do it I think you will find the work to get everything behaving correctly is way more than it is worth.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good evening, I would like to have a navigation bar which is centralised to
I have a navigationController which has a navigation bar. I would really like to
I have made a navigation bar using <ul> and <li> I would like to
I've I have a simple noob question, I would like to hide the navigation
I have a navigation bar that I would like to keep at a fixed
I would like to have a vertical navigation bar with these images. I seem
I would like to have a more colorful Python prompt in the terminal, just
I would like to set the color of the navigation bar on my app
I'm building a website, and would like to make aa navigation bar with submenus.
I have an ipad app where i would like to hide and show a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.