How to remove navigation bar in ios?

Rain picture Rain · Sep 20, 2013 · Viewed 14.1k times · Source

enter image description here

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


}

- (void)viewWillDisappear:(BOOL)animated
{
    [self.navigationController setNavigationBarHidden:NO animated:animated];
    [super viewWillDisappear:animated];
}

It's a screen shot when up corner it's slightly display.

I used this code for hide the navigation bar in view.but when view will start then it's give me effect like navigation bar are present.

But, I want to remove this effect or remove the navigation bar only this view.

Answer

Hemant Singh Rathore picture Hemant Singh Rathore · Sep 20, 2013

In Case if you are using storyboard Make sure green arrow highlighted fields are unchecked  attribute inspector

Option 2

Put below lines of code in didFinishLaunchingWithOptions

[self.navigationController setNavigationBarHidden:YES]; –