Mihai P
Mihai P

Reputation: 23

iOS Navigation Bar: Hidding the navigation bar and smooth transition

I have a hierachy of view controllers inside a navigation controller and I for the root view controller I set the "hidden" property of the navigation controller bar to YES. All of its children have the "hidden" property set to NO. The problem is that I don't know where is the best place to hide the bar, because when I press the "back" button to return to the root view controller I can see how the navigation bar dissapears and the root view controller view's resizing and this is not a good user experience.

Upvotes: 2

Views: 830

Answers (1)

Dima
Dima

Reputation: 23624

Where did you put your hide/unhide calls? The best place will probably be in viewWillAppear, such as in this post.

Something like:

if (![self.navigationController isNavigationBarHidden]) 
{
    [self.navigationController setNavigationBarHidden:YES animated:animated];
}

Upvotes: 2

Related Questions