Gedeon
Gedeon

Reputation: 53

Hiding just one navigationBar in navigationController stack

I am trying to get the same functionality as contacts app in iphone. The problem is following , when i hide navigationbar using following command

[self.navigationController setNavigationBarHidden:YES animated:YES]

It gets hidden throughout all viewControllers in navigationController stack.

I am implementing search in my application pretty much the same way it is in Contacts app. When user touches search field it hides navigationBar, but when user selects item from table view transition I want it to stay hidden in rootViewController and to be visible in pushed viewController.

I was thinking about completely hiding navigationControllers navigationBar and placing my own navigationBar, but i am not sure is it right direction to take.

Upvotes: 2

Views: 760

Answers (1)

Gaurav Verma
Gaurav Verma

Reputation: 536

add following code tot the desired view controller, and it will work fine

- (void) viewWillAppear:(BOOL)animated{
    [[self navigationController] setNavigationBarHidden:NO animated:YES];
}

hope it helps.

Upvotes: 2

Related Questions