views:

172

answers:

1

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.

A: 

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.

Gaurav Verma
As far as i know , viewWillAppear method is not fired when using navigationController.
Gedeon
it will fire. I am using same technique in one of my application.
Gaurav Verma