Question

I am using Storyboards

I have 3 view controllers (A, B, and C) that I want to have arranged, so that each one segues into another; like a directed triangle.

A is reached from another controller (lets call it A'), it segues into B, and that segues into C; and I want C to segue back to A.

A' is embedded into a navigation controller, and so A,B and C have a bar as well. However when I make a segue from C to A, that bar disappears from all three view controllers.

How do I prevent this from happening? Should I add a UINavigationBar to each of the 3 controllers?

Était-ce utile?

La solution

I actually figured this solution a while back, completely forgot about this question. In the storyboard, select the view controllers you are having issues with and, in the Attributes Inspector, change the Top Bar setting to a specific type of navigation bar rather than Inferred. This keeps the bar visible at all times for the corresponding UIViewController

I assume, of course, you have a segue path that contains a UINavigationController somewhere before your respective controllers. I'm not sure if it would work without one.

Autres conseils

I have this issue too. Things are good in simulator but they are not displayed correctly in storyboard. You can use following code in the action of bar button to do it:

[self.navigationController popToViewController: [self.navigationController.viewControllers objectAtIndex:0] animated:YES];
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top