Hide navigation bar

Viewed 53509

I have 3 views. (say 1st,2nd,3rd). I have pushed the 2nd view (which has a load view method) on the 1st. In the 2nd view I have created the 3rd using initWithFrame (which is inherited from UIWebView). In 2nd view I wrote self.view=3rd view.

Now I want to hide the 2nd view's navigation bar in the 3rd view (i.e., when the user touch to 3rd view screen i.e. UIWebView). I got the touch recognition using gesture, but I can't hide the navigation bar.

3rd view don't support self.navigationController. And if I create 2nd view's object in 3rd, it does not hide the navigation bar. Can anybody help me?

4 Answers
- (void)viewDidLoad 
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.

     [[self navigationController] setNavigationBarHidden:YES animated:YES];
    //[self dismissViewControllerAnimated:YES completion:NULL];
}
Related