I'm not sure what's happening with my Navigation Controller. I have a window with a Tab Bar Controller and 3 Navigation Controllers, they work fine when switching between the views they're set to.
However one View Controller has a Button in the View that pushes another View Controller onto the Navigation Controller, only the back button doesn't come up. I've made a screen that pops a copy of itself to the View Stack and when there are 3 or more Views on the stack, the back button shows up, until it gets to that second view again, and it disappears. Has anyone run into this problem before?
Related
I have a view controller which is connected my tab bar controller. This view controller also has a segue connection to a pop up view controller. As shown in the image below.
The problem is having is that the tab bar is being placed at the front of my pop up view controller like below.
I don't want this to be clickable since some weird behaviour happens when you press an item on the tab bar. So is there a way to send this to the back or hide this tab bar controller?
It's worth noting that in the class for this view controller there isn't an IBOutlet for this tab bar controller so i'm not able to access it in this view.
Removing a tab bar controller from a view controller where a pop-up or alert is only partially covering the background (or parent) view controller could be confusing or wierd looking to the user.
If you have access to your tab bar controller via an IBOutlet, you could disable touches to it by setting .userInteractionEnabled to false and setting the alpha of it to 0.7 or 0.6, giving an impression that it's temporarily disabled while the pop up is appearing.
If you don't have access to your tab bar controller (I just noticed that comment in the last sentences of your question), you could also register a notification observer in the class that does hold the tab bar controller outlet and you can send custom events (that you define) like "popupViewAppeared" and "popupViewDisappeared" to enable/disable the tab bar controller.
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!
I have been trying to properly setup a navigation bar in one of my View Controllers for an hour now and have not found any working solutions.
I control-clicked on a button on my app's initial view controller(1st VC) and dragged to another view controller(2nd VC) and selected "modal" as the action segue.
I then added a navigation bar item to my 2nd view controller.
When I run my app on my iPhone, I can tap on the button on my app's initial screen and it will take me to my 2nd VC, and the 2nd VC does display the navigation bar, but the navigation bar does not have the default iOS 7 back arrow to let me go back to the app's initial VC.
I was under the impression that this could be setup exactly like I did above and that the back button functionality would be included by default.
Am I completely lost? Do I need to further customize navigation bar programmatically or with a tick box in the attributes inspector? Is "modal" the wrong action segue option?
I basically just want to have navigation bars at the top of a couple of my VC's so that the user can easily get back to the app's initial screen.
Thanks for the help.
Since you are presenting your second screen (2nd VC) as MODAL from your first screen (1st VC), you will not see the back arrow button on navigation bar. Your understanding about back button works for Navigation view controllers (push segue). For MODAL you need to put a cancel button on second VC's Nav bar and put a dismiss action for that.
I'm creating a Tab based application. One of the tab buttons displays a navigation controller when pressed. Which in turn displays the default root view controller associated with that navigation controller.
I want to allow the user to go backwards past the default controller that is displayed when clicking that tab bar button. Conceptually the "main" controller that is displayed when the user clicks the tab bar button would be the second controller in the navigation stack.
The reason I'm doing this is that the "back" controller is to be a kind of setting screen. Changing the setting would effectively make the "main" controller invalid and would need to be recreated. I know I could do settings screen as a modal view controller but when the modal controller is to be dismissed after the setting has been changed I would have to destroy the "main controller behind and rebuild it.
So my idea is to just pop the "main" controller off the stack to the settings screen and then once they have chosen the setting push a new instance of the "main" view controller onto the stack.
My two ideas were to implement this are:
Set the navigation controllers root controller to my "back" controller and push the "main" view controller on top. Then somehow override the tab bar button so that it always displays the second controller first, which exposes the back button in the navigation bar.
The other idea is to set the "main" view controller as the navigation controllers root , and then add a custom back button to the navigation bar which when clicked would somehow insert the "back" controller before the current one and then pop to it when clicked.
I've not been successfully with either of these approaches. I've seen over apps do this mainly Twitter apps where you can go back past the default controller that is loaded when clicking the tab bar item.
Anyone know how to do this? I would prefer to go down the tab bar button triggers the second controller in the navigation stack to be loaded by default.
If this is the apporoach you want to take, you could set yourself as the tabcontroller delegate and implement the method:
-tabBarController:didSelectViewController:
Here you can check if the selected controller is your navigation controller and then pop to the viewController you want.
I have a navigation controller and a tab bar where I have buttons for multiple options. When a button is ever pressed it pushes its respective viewcontroller in navigation controller. That's fine, but when I again press the button in tab bar after loading any other suboption viewcontroller in navigation controller, it shows blank screen instead of that "options screen" which it shows when I touch it first time.
I am using this code:
[self.navigationController pushViewController:accountOptions animated:NO];
You're pushing same view controller twice without ever poping it from navigation controller.
You can either pop view controller when switching to another one or push view controllers once on navigation controller in tab bar and be done with it.