Unable to hide Navigation Controller's tool bar - ios

I have a controller (Search Controller) thats embedded inside a navigation controller and a tab bar controller. I then have a container view inside Search Controller that embeds a navigation controller.
For some reason I cannot hide the navigation controller's tool bar that is embedded inside the container view. This is how I am attempting to hide the tool bar.
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self.navigationController setToolbarHidden:YES];
[self.tableView reloadData];
}
No matter, the tool bar at the bottom of my controller will have a tool bar that covers my container view's content. Any ideas why this is happening and how I can hide the toolbar/(tab bar?)? Thanks.
Picture of the problem:

I'm not sure exactly what was going wrong or what the proper fix was. But to 'kind of' fix the problem, I simply enlarged the container view underneath my tab bar so that the tab bar I am unable to hide is hidden beneath my universal tab bar.

Try to use:
self.tabBarController.tabBar.hidden = true;

Related

ViewController in separate storyboard using RBStoryboardLink has extra 20px black status bar when hide navigation bar

I tried using RBStoryboardLink to separate storyboard in my project, and in one of the storyboard, I have an initial view controller which is embedded in navigation controller,and I use [[self navigationController] setNavigationBarHidden:YES animated:NO]; to hide navigation bar.
However it will introduce a 20px black area in status bar as below
I have tried options such as uncheck extend edges under top bars or uncheck adjust scroll view insets but nothing works so far.
anyone has any clue how to resolve this issue?
Thanks.
Ok, I managed to find a solution for my case.
The key is _needsTopLayoutGuide
I customised another called RBStoryboardNoNavLink and set _needsTopLayoutGuide to NO in that class, and if the storyboard link is a tab child view controller and do not want navigation bar (or do not embed in navigation controller even), can just rename that class to RBStoryboardNoNavLink and it works perfectly for my case.

Remove navigation bar from main controller in Xcode?

I have a main view controller in Xcode 6 (program is in swift) on which I have a few buttons that lead to certain navigation controllers. When I test the app, the first time I see it it looks fine (without a navigation bar at the top). When I click on a button on main view controller, it shows the navigation controller I selected, everything acts perfectly again. The problem happens when I click on the bar button "back" on that nav controller in order for it to show me my main view controller again. When I'm back to the main view controller, there's a navigation bar at the top that isn't supposed to be there. I want my main view controller to have no navigation bar at the top. I tried to use push, modal and show segues to see if it might be the problem, but I still can't figure it out. Any thoughts on what might be happening?
Sounds like you need to re-hide your navigation bar. To do that, add:
self.navigationController?.navigationBarHidden = true
to the viewWillAppear of whatever view controller for which you'd like to hide the nav bar.
Updated for Swift 3:
self.navigationController?.isNavigationBarHidden = true
In mainViewController, write code to hide navigation bar in viewWillAppear method.
in Objective-C
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:YES];
[[self navigationController] setNavigationBarHidden:YES animated:NO];
}

Position off for view when using pushViewController

I have a view which is located inside a navigation controller which is inside a tab bar controller like this:
Tab Bar Controller
Navigation Controller
View Controller
I have designed the layout of the View Controller in a xib. When I click the tab for the view the view is displayed correct. The view will be place within the navigation bar and the tab bar - it will not overflow.
But when I want to open the view programmatically - not via the tab bar - but with pushViewController [1] the view expands all the way to the outer bounds of the frame. The view will be over the status bar and below the tab bar.
I cannot find a solution to this. Does anybody have any ideas how to solve this?
[1]
[self.navigationController pushViewController:[[MyViewController alloc]
initWithStringAddress:"someIdUsedInController" animated:YES];

hide navigation bar throughout the app

I know using below statement I can hide navigation bar.
[self.navigationController setNavigationBarHidden:YES animated:NO];
But I want to do this for whole app.
I don't want to write this statement in all files.
So any idea how can I hide navigation bar for whole project?
If you have used Storyboards, then setting the Navigation Bar to None in the Navigation Controller, and ensuring that the top bar is set to 'Inferred' for all view controllers contained within the navigation controller will ensure that the navigation bar will be hidden for all view controllers in the navigation controller.
You can also use
self.navController.navigationBar.hidden = YES;

iOS Navigation Bar: Hidding the navigation bar and smooth transition

I have a hierachy of view controllers inside a navigation controller and I for the root view controller I set the "hidden" property of the navigation controller bar to YES. All of its children have the "hidden" property set to NO. The problem is that I don't know where is the best place to hide the bar, because when I press the "back" button to return to the root view controller I can see how the navigation bar dissapears and the root view controller view's resizing and this is not a good user experience.
Where did you put your hide/unhide calls? The best place will probably be in viewWillAppear, such as in this post.
Something like:
if (![self.navigationController isNavigationBarHidden])
{
[self.navigationController setNavigationBarHidden:YES animated:animated];
}

Resources