I have a main screen that is a Tab Bar controller with 4 tabs. One of the tabs takes you to a navigation controller where you can click through 3 different Table View Controllers.
I also have a button on one of the other tabs. I would like this button to take the user to the end of one of the Navigation controllers.
I can perform the segue just fine, but when I use the button to get to the View Controller, the tabs on the bottom aren't there, it's just a table.
Is there any way I can segue to a View Controller within a Navigation controller from outside the navigation controller and still have the tab bar showing?
Here are some pictures of what I mean:
See how at the bottom of this page there is the tab bar still? This is when you get there from the navigation controller
And in this picture, there is none (This is the friends page, same as picture above). I arrive at this by using a segue from a button from one of the other tabs.
Please let me know if I need to be more descriptive but I can't figure out how I can make this happen. Thanks for the help!
Related
Attached are two images. The first shows my current main.storyboard, and the second shows my problem when I run the app. I have a tab bar controller that has two tabs. On the first tab there is a button. When pressed, the button goes to another view controller with content. At the top is a Navigation bar with a back button. After viewing content, I press the back button, and am back on the original page with the button, but the tab bar is missing. I have seen a few answered questions, but it appears they made their tab bar in the view controller instead of the storyboard. Another says that I should never return to a previous view unless I use an unwind segue. Is this true? If so, how do I set up an unwind segue. If not, how do I fix this problem otherwise? Thank you.
http://i.stack.imgur.com/IYmX2.png
http://i.stack.imgur.com/7slt5.png
The problem is in the wiring of your ViewControllers. You have probably embedded your UITabBarController inside the UINavigationController and not the other way around.
A correct layout looks like this in Interface Builder :
To reproduce:
In Interface Builder drop a UITabBarController. This will come with 2 UIViewController's already wired in.
Pick one of the UIViewController's (let's call it VController1) and click on Editor / Embed in / Navigation Controller. This wires the VController1 to live inside a UINavigationController that is inside the UITabBarController
Add a 3rd UIViewController next to VController1 Let's call it VController3
Wire in a segue between VController1 and VController3, for example with a button.
I hope that's clear enough
Try Linking the button in your viewcontroller (other than the views of the tabbed bar controller) with the tabbed bar controller. Create a segue that links the button with the controller of the tabbed bar application
I have 3 View controllers in a tab bar. (my 3 icon). I have another view controller that is accessible from one of the 3 via a button. I do not want this extra view controller to show on the tab bar though.
On clicking the button with a push segue nothing happens, with a modal segue it opens the new page, but the tab bar disappears. (Even though I created a relationship from this new view controller to the tab bar).
How do I get the tab bar to remain? I don't really want to set up a navigation controller between my one view and the other (not on the tab bar) because it's not really hierarchal content.
Is modal actually the right segue to use?
Does your views (the views of the 3 views controller) contain the tab bar? If not, you may try transiting from the view to the view of the extra view controller.
see +[UIView transitionFromView:toView:duration:options:completion:]
When you select a Modal segue, the new view is not added as part of the current TabController stack. That's why the tab bar is not visible when you go to this view, and it's why a Push segue does not work for you (you can't push a VC that's not part of the stack).
From the sounds of it, if you want the tab bar to remain visible/useful but don't want to add this VC to the tab bar, what you're really saying is that this VC is a sub-view of one of the original 3 VCs in the tab bar.
In which case you could manage instantiation of your "custom" VC from within one of these original VC's, and add it as a sub-view?
For example if you've got: Tab1, Tab2, Tab3 and ExtraView
in Tab2 VC you would init/alloc SubView and do: [self addSubView:ExtraView.view];
Unfortunately, of course this way you lose Segues, but unless you want to go ahead and set up Tab2 as nested NavigationController in Storyboard, I think that's your best bet.
I have an issue with a tab bar app. I am making a tab bar app with three bars on the bottom. On my my first bar it is a tableviewcontroller. When i ckick on the table view controller it takes me to a different view (which doesn't have the tab bar). When I clicked back to the home screen (which has the tab) the tab bar is gone.If you need a picture i will post it!
You may have set your UITableViewController segue to a modal style. If this is the case, you should change it to a push style.
In order for a push to work, your view controller needs to be in a UINavigationController. In your story board, select your root view controller and embed it into a Navigation Controller like this...
I'm trying to add a view that is a form that has 3 elements. These elements will be inside of a static grouped table. I need a navigation bar at the top with a "Save" and "Cancel" button. Both buttons should send the user back to their previous screen when tapped.
Within the storyboard, I have tried creating a Navigation Controller and then adding a table to it, but I get the error of "Static table view are only valid when embedded in UITableViewController".
So, I tried creating a Table View Controller, but the storyboard won't let me put a navigation bar into one of those for some reason...
What is the best way to go about doing this?
Add UITableViewController to your storyboard and then choose Editor > Embed in > Navigation Bar Controller from the menu. This will wrap your table view controller in a nav bar controller and you can then add your Save and Cancel buttons to the navigation bar.
It might seem a bit wasteful to create a navigation controller with only a single sub-controller just to get a navigation bar but it's the accepted way of doing it.
Oh... this iOS stuff is hurting my head.
I wanted to do the same thing, have a TableView, with a Navigation Bar at the top, but there was no "Embed in.. Navigation Bar" menu item, just "Embed in.. Navigation Controller".
Eventually, solving this was easier than I thought.
I just needed to add a Table View Controller to my storyboard, then CTRL+drag a Segue from the "calling" view controller to my new Table View Controller, and, voila, it gives me the Navigation Bar straightaway.
Hello everybody i need your help.
I am making a tab bar based application in iphone. i have more than 5 button to show in tab bar. when i did it, five button displayed fifth button is more..... but when i clicked on more then more button came in a table view not in tab bar.
That's how it works. From the documentation (http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html%23//apple_ref/doc/uid/TP40007457-CH102-SW2):
If you add more than five items to the
viewControllers property, the tab bar
controller automatically inserts a
special view controller (called the
More view controller) to handle the
display of the additional items. The
More view controller provides a custom
interface that lists the additional
view controllers in a table, which can
expand to accommodate any number of
view controllers. The More view
controller cannot be customized or
selected and does not appear in any of
the view controller lists managed by
the tab bar controller. For the most
part, it appears automatically when it
is needed and is separate from your
custom content. You can get a
reference to it though by accessing
the moreNavigationController property
of UITabBarController.
That is intended behavior and not an issue, if you read the viewController Programming guide you could have seen that right away: http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007457