iphone - Possible to switch out View Controllers managed by a UINavigationController? -
I am breaking the normal pattern of a UINavigationController, or at least I'm trying
We know that the Navigation Controller manages the navigation through a stack. If I start with root controller A, navigate to b, and then navigate to c, the stack will appear - c / b / a.
However, what I want to do is, it has a button which will show another view, X is called, but still keep the navigation controller's nav bar in place, basically "C" on the stack and Switch "X" I tried to finish immediately by popping C and immediately pressing X as shown below, but it does not work. Am I going down the wrong path here?
- (IBAction) showViewX: (ID) sender {[self.parentViewController navigationController] popViewControllerAnimated: NO]; XViewController * xViewController = [[XViewController alloc] initWithNibName: @ "X" bundle: [NSBundle main bundle]]; [[Self. Point View Controller Navigation Controller] Push ViewController: Animated xViewController: Yes]; [XViewController release]; } "
What do you call" visual c "in fact" controller c See "Since this is a visual controller, you can easily set it to switch between two, x, y, so that's why you only leave c on the stack, do not pop it up and between the scenes only in C. For example, you can set C to use Toolbar to switch between views.
Comments
Post a Comment