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

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.

Related

NavigationBar not appearing in second view controller

i am working on iPhone app.. i am using navigation controller, but the when i am going to the second view controller i.e. to the child view controller, the navigation bar is not appearing i had tried all the solutions around. Changing the property from translucent to inferred, vice-versa, tried doing it in code in viewDidLoad, viewDidAppear, viewWillAppear, everything..
Need some help..
In simulator it is showing and working perfectly but in device it isn't. I am using iphone 4s.
Check screenshot at below location:
http://postimg.org/image/y3nzz6t79/
I wanted to use below existing Back functionality - hence the transitions:
http://postimg.org/image/r2q34a4sr/
Try to embed your second view controller with Navigation Controller.
Set Top bar property to Opaque
Add this code in ViewDidAppear
[[self navigationController] setNavigationBarHidden:NO animated:YES];

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

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

Hide bottom bar on demand

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.

pushViewController without navigationcontroller

I have a class that is of type UITableViewController.
This class has a member of type UINavigationBar that I use for adding in an edit button for the table view.
Using this method calling is invalid.
[self.navigationController pushViewController:controller];
How can I push a detail view onto the view after selecting a table row without wrapping my UITableViewController in a UINavigationController?
The closest alternative if you don't want to use navigation controller are modal view controllers.
[self presentViewController:controller animated:YES completion:nil];
This will slide the controller into your screen from bottom, or if you change controller's modalTransitionStyle it can flip over or fade in.
To dismiss the controller just call:
[self dismissViewControllerAnimated:YES completion:nil];
I would wrap the UITableView inside a UINavigationController and just hide the UINavigationBar.
[self.navigationController setNavigationBarHidden:YES animated:NO];
And then create a back button that pops the ViewController off the stack.
[self.navigationController popViewControllerAnimated:YES]
What could also be done is to use a Navigation Controller as usual and then hide it.
To hide the Navigation Controller using storyboards: select it and uncheck "Show Navigation Bar" in the attribute inspector. Others might suggest to hide the navigation bar in each controller, but the problem with that is that it will appear for a millisecond and then disappear.
You can't push a view controller onto a navigation controller if there is no navigation controller. If you are wanting to be pushing controllers and have it display the topmost controller and everything, just use a UINavigationController and be done with it.
You can push arbitrary UINavigationItems onto your UINavigationBar, and your bar's delegate will be notified when the user uses the back button so you can take appropriate action. See the documentation for more information.
It's true that without a UINavigationController you can not push view controllers. You rather present view controllers modally via UIViewController.present(_ viewControllerToPresent:, animated:, completion:)
But it's possible to create a custom segue to display the view controller as if it were a push (or any other animation you want), although it seems that using a UINavigationController just makes things easier.
Here are some related links to the documentation:
UINavigationController Class Reference
Customizing the Transition Animations
Presenting a Modal View Controller

Resources