首先,我知道这个问题是以向前的方式提出的,但在这种情况下,我要求的是已经设计了导航 Controller 的向后方式。话虽这么说...
我有一个 UINavigationController
三个 View :Table
, Get
, 和 Avail
按照在 IB 中创建的顺序。
前进时,我想从Table
出发至Get
至Avail
,但是当我点击 Avail
上的“返回”按钮时我想跳过Get
并直接返回Table
.这可能吗?如果是这样,怎么做?
最佳答案
我是这样做的:
NSArray *VCs = [self.navigationController viewControllers];
[self.navigationController popToViewController:[VCs objectAtIndex:([VCs count] - 2)] animated:YES];
为了能够覆盖导航 Controller 的后退按钮,您必须继承 UINavigationController。查看本教程中的方法:http://www.hanspinckaers.com/custom-action-on-back-button-uinavigationcontroller
关于objective-c - NavigationController 返回跳过 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8539411/