开发者

Hiding just one navigationBar in navigationController stack

开发者 https://www.devze.com 2022-12-17 10:41 出处:网络
I am trying to get the same functionality as contacts app in iphone. The problem is following , when i hide navigationbar using following command

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 stac开发者_Go百科k.

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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号