- (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.
In Case if you are using storyboard Make sure green arrow highlighted fields are unchecked
Option 2
Put below lines of code in didFinishLaunchingWithOptions
[self.navigationController setNavigationBarHidden:YES]; –
The thing to remember is that views will be drawn in a particular order, and they are uniquely affected by your navigation bar. Based on when you hide your navigation bar your other views may change size or position.
Try putting this in viewDidLoad:
self.navigationController.navigationBarHidden = YES;
And then, in viewWillAppear, add your view placement and configuration code.
This strategy will remove the navigation bar FIRST, then properly place and size your assets accordingly.
Happy coding!
Please use this [self.navigationController setNavigationBarHidden:YES];
or self.navigationController.navigationBarHidden = YES;
to hide the navigation bar in the view you want it hidden.
Use this may be help full for you
-(void)viewWillAppear:(BOOL)animated{
self.navigationController.navigationBarHidden = YES;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With