Navigation bar from tab bar controller hides child's nav bar - ios

I am confused with behavior, I have Tab Bar Controller ( I enter on this controller from simple view controller which is embedded in navigation controller). I am confused why is that navigation bar from tab is covered up child navigation bar.
When I start app and I enter at Browse Controller I cannot see Browse title, neither nav bar items which I added programmatically. Can somebody give me clue what is wrong ( I am new to this, I connect with push segue from tab to browse).

Your problem appears to be the same as the one I addressed here:
Push segue from a view controller controlled by UITabBarController
What's happening is that your first NavigationController is creating a Navigation stack. Then you push-segue a TabViewController. That is added to the Nav stack, along with each of it's contained view controllers. However, when you PUSH SEGUE from one of those view controllers to some other view controller, the original navigation controller's stack is the one you are pushing on to. This is not contained inside the tab view controller, so the pushed view controller has no relationship with that tab view controller, just the original navigation controller stack. Therefore the tabs are not present.
The answer is to embed each of the tab controller's view controllers in a new navigation controller, and push on from those. The original navigation controller is just messing things up here...

Related

Navigation Bar and navigation items not visible on runtime

I don't understand why SignIn and SignUp navigation Bar and the back buttons are not visible even when embedding both of these views in the navigation controllers.
Is there anything else we have to do in code. All top bars are inferred in this case and I haven't touched the visibility of any.
There is no back button because there is nowhere to go back to. Your sign up and sign in view controllers are the root view controllers of their respective navigation controllers.
There is no visible title because what you are looking at is the navigation item of the tab bar controller, which has no title.
Your architecture posits a navigation controller insider a navigation controller, which is illegal:
nav controller -> tab bar controller -> nav controller
You can't do that.
Also you can't put a tab bar controller inside a navigation controller. A navigation interface inside a tabbed interface is fine (as illustrate in Apple's own docs: https://developer.apple.com/documentation/uikit/uinavigationcontroller). The reverse, a tabbed interface inside a navigation interface, is not.
The simplest solution is to eliminate the first navigation controller completely, as there is no need for it (you are not pushing anything onto it beyond its root view controller).
IN SIMPLE TERMS
Logically, your Tabbar should not be embedded in a UINavigation Controller. Instead, delete the NavigationController and make the Tabbar the root Viewcontroller then embed each UIViewcontroller in a separate Navigation controller

Navigation Bar not showing in embed Navigation Controller

I'm trying to display the navigation bar at the top of the screen, but it's not showing in embed navigation controller.
Here is how it is in the storyboard:
And here it's in the simulator:
As you can see, I created a custom TabBar (following this tutorial) at the bottom of the screen so I can navigate between the different views.
I believe that I'm going to have to load the navbar programatically because the only solution that I found was to set the navigation controller as the initial view controller, but I already set another view as the initial one so I can't do that.
Issue :
When you instantiate a viewController using storyBoard identifier they wont come with free embedded navigation controller, even if you have added a NavigationController to them. As a result you are adding a viewController without navigation bar to your tab bar VC.
Solutions:
Solution1: If you want each child viewControllers to carry their own navigation controller hence their own navigation stack, provide a storyboard identifier to Navigation Controller behind your child viewControllers and instantiate the Navigation controller itself rather than ViewController. And add NavigationController as you tab bar looking VC's child. Because navigation controller loads the embdedded VC by default you will see your child VC with nav bar.
Solution2: All that you care for is only nav bar than add the Navigation Controller behind the VC containing tab bar looking View.
Hope it helps
Have you tried constraining the navigation bar to your view? Otherwise it can move offscreen.
You need to point the tab bar controller segue to the navigation controller of your view - otherwise if you point the segue straight to the view you're just loading the view without any navigation controller attached.

How to segue to a specific view controller inside a tab bar controller with losing the tab bar?

Currently I have a tab bar controller that is connected to various navigation controllers like this:
I'm trying to navigate from one view controller to another view controller that is in a separate navigation controller. The only way I've been able to figure out how to keep the tab bar from disappearing is to create a modal segue to the original tab bar controller. The only problem doing this it automatically goes to the default tab bar viewcontroller and not the one I'm trying to reach.

Navigation Tab Bar Controller to UIView Controller?

I am using tab bar controller and i want to push uiview controller over tab bar controller. but i don't know how we push UIView controller over Tab Bar Controller. Thanks
You need to embed a navigation controller in your tab bar controller screen where you want the push set up to work
If I'm reading your question right, you want to push a view controller over another view controller which is currently displaying tabs.
In this case, I believe you would need a UINavigationController as your root view controller. Inside this navigation controller, you would initially push a UITabController with it's associated view controllers per tab. When it's time to push another view controller over the tab controller, create an instance of the view controller to push and use the following code:
[self.navigationController pushViewController:newViewController animated:YES];
This will push the new view controller over the existing TabController that is currently being displayed.
The question is little vague Hence I will add the two way to push to another view controller we use in common.
From navigation controller : You just need to create an UIButton in the navigation controller and then control + drag the button to another view controller to create a push feature to another screen in storyboard.
From Tab view Controller : Similarly, control key + drag the tab bar item in the tab bar controller to another UIView controller in the story board. Then chose 'show' option to create a push to another UIview controller screen.
Hope this helps.
Tab Bar controller is different and Navigation Bar controller is different.
And as Pittmaster says, your navigation view controller should be root view controller.

How to prevent tabbar from hiding with SWRevealViewController?

I'm trying to find out why any ViewController, that I push onto navigation stack does not show tabbar. Now I have construction like this:
loginVC -> navigationController -> SWRevealVC --> (leftPanelVC and second segue is to tabbarController, which has 4 its own view controllers). When I push view controller from any of this 4 controllers I'm loosing my tabbar and I cannot bring it back. Tried hidesBottomWhenPushed but it didn't work out as expected. Anybody?
EDIT:
What I just tried, was to set connections like this: login -> tabbarcontroller -> as first subcontroller I set up SWRevealViewController and hooked to it front navigationController and rear tableController. Unfortunately it messes stuff a bit, because tabbar now stays always, even on top of rear controller... the look I'm trying to get is interaction like in facebook app, where tabbar is always visible, but as a part of front controller, not overlaying rear.
When I push view controller from any of this 4 controllers I'm loosing my tabbar and I cannot bring it back.
I am not sure what you are doing here, but as far as I understand, you have:
pushed a tab bar controller on to a navigation controller;
from that tab bar controller, pushed a new view controller on to the navigation controller.
It that is correct, than it is normal that your tab bar controller tab bar "disappears" since you are pushing a new view controller (point 2) on to the navigation controller and this will replace the tab bar controller as the top most controller in your navigation controller.
Possibly, what you are looking for can be obtained by embedding a navigation controller inside of a tab bar controller, but I do not have enough info about your UI to be sure this makes sense.

Resources