Hide bottom bar on demand - ios

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.

Related

Weird animated on pushing controller hiding tab bar and adding a toolbar

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.

How to make UIView go fullscreen when entering edit mode

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];

How to hide/show custom navigation bar?

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

Why Does presentModalViewController:animated: Turn The Background Black?

I am using presentModalViewController:animated: and while functionally it works correctly visually it has an artifact I want to remove. When the modally presented viewController appears its parent viewController is completely hidden with the background turning black. This is not what I want. My child viewController's view is translucent and I want to reveal the parent viewControllers view behind it. The effect I want is a piece of tracing paper sliding over the background.
I assumed presentModalViewController:animated: supported this. Is that not the case?
Thanks,
Doug
NavigationController and the View Controllers are designed in such a way that only one view controller may show at a time. When a new view controller is pushed/presented the previous view controller will be hidden by the system. So when you reduce the modal view's alpha you will possibly see the window's backgroundColor (the black color you see now).
If you want a translucent view to slide-in over the main view, you can add the view as the subView of main view and animate it using UIView Animations.
This may get you what you want:
presentingViewController.modalPresentationStyle = UIModalPresentationCurrentContext;
presentingViewController.modalPresentationStyle = UIModalPresentationCurrentContext;
doesn't work after ios7,you can fix it by after
presentingViewController.modalPresentationStyle = UIModalPresentationOverCurrentContext;
presentingViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
then both:
[appViews.rootViewController presentViewController:presentingViewController animated:YES completion:nil];

UINavigationBar moves my view

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.

Resources