I have a UINavigationBar that is hidden most of the time my app is running.
however when i was it to show i call
[navigationController setNavigationBarHidden:NO animated:YES];
the view currently showing is resized..
i then unchecked the "auto resize" option in interface builder.
now the view is moved down.
i there a way to load the navbar over the top of the view so it does move my view?
Many thanks
You need to put your own navigationbar by picking from the Library.
use this code and put your navigation bar in the XIB of the view.
[navigationController setNavigationBarHidden:YES animated:YES];
Other wise your view will be come down by 44 points the height of the navigation bar.
Related
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;
I have an app with the hierarchy of UITabBarController > UINavigationController > UIViewController. Currently if you tap on the collectionView's cells it performs a segue to show the full size image. I have the view controller that is being pushed setting the hidesBottomBarWhenPushed property to YES. Then in viewWillAppear: on the view controller being pushed, I am calling [self.navigationController setToolbarHidden:NO animated:NO] and as you can see in the animated below the bottom left of the screen is present from the previous screen.
Change ur code to this: Set animated YES.
[self.navigationController setToolbarHidden:NO animated:YES]
So it turns out that I had to have the view controller being pushed go under the bottom bar otherwise it gave the weird animation. When I did that everything went back to normal. I then also animated the call to setToolbaHidden:animated: as suggested above.
I have a UITableView that renders in the context of a UINavigationController (and maybe even a TabBarController). There is a way to make the UITableView enter editing mode. When that happens I want the table to get 'focused' and the navigation bar and tab bar to go away (the table view has to expand to fill the empty space). Then when editing mode completes, it should all go back to normal. Anyway to achieve this with standard iOS view and controller functionality. Or do I have to start hiding controls and resizing the view manually?
You could use a modal view to accomplish this.
Have a look at the documentation for [UIViewController presentViewController:animated:completion:]
If you just want to show the UINavigationBar and the UITabBar to disappear, you can just use:
[self.navigationController setNavigationBarHidden:YES animated:YES];
Otherwise, you can show an editable version of the UITableViewController and push it onto the navigation stack:
viewController.hidesBottomBarWhenPushed = YES; // this property needs to be set before pushing viewController to the navigationController's stack.
[self.navigationController pushViewController:viewController animated:YES];
In my iOS application, I'm using custom NavigationItem (added to root view from Nib file). For default NavigationItem I can use
[self.navigationController setNavigationBarHidden:YES animated:YES];
to hide them, but I didn't find any way to hide my custom NavigationItem or removeFromSuperview, could somebody please kindly show me some pointers?
Thanks in Advance!
with [self.navigationController setNavigationBarHidden:YES animated:YES]; you hide the complete navbar and not only the navItem. As far as i understand you added the navitem as a subview. You have to keep some kind of reference to the UIVview eg. with a property or a tag and then remove/hide the navItem.
Since you just hide the navBar it is still there. So you can move you views with their frame property.
So I guess you it is enough to move the content views and skip the hiding / removing at all.
you should create outlet for your navigation item and the you can animate/hide by writing code your self
I have a UINavigationController inside a UITabBarController. I'm presenting a sort of popover view using a semi-transparent UIView, but am not calling presentModalViewController or any of the usual methods. I know about hidesBottomBarWhenPushed, but is there a way I can hide the bottom bar (or even betterm slide it out) on demand (just before my subView is added to the navigationController's top view)?
Have you tried setting this property?
navigationController.toolbarHidden = YES;
Or with animation:
[navigationController setToolbarHidden:YES animated:YES];
See answer https://stackoverflow.com/a/9141766/305351 to related question.
Specifically Borut Tomazin's comment and his solution https://gist.github.com/borut-t/6507423.