来自另一个导航控制器的现有导航控

时间:2014-10-27 13:08:42

标签: ios objective-c uinavigationcontroller

我有UIViewController嵌入UINavigationController内,我想在第一个导航控制器的UIViewController内展示另一个导航控制器。

问题在于,当我提出并解雇UINavigationController第一个导航控制器的后退按钮消失时,我想呈现navCtrl,当我解除它时,第一个UINavigationController的后退按钮1}}仍然

VendorsViewController* vendorsVC = [[VendorsViewController alloc]initWithNibName:@"VendorsViewController" bundle:nil];
NSMutableArray* vendorListArray = [NSMutableArray arrayWithArray:self.cachedVendorList.crossSearchResults];
[vendorListArray insertObject:@"All Vendors" atIndex:0];
UINavigationController* navCtrl = [[UINavigationController alloc]initWithRootViewController:vendorsVC];
[self.navigationController presentModalViewController:navCtrl animated:YES];

1 个答案:

答案 0 :(得分:3)

创建第二个UINavigationController并将其rootViewController设置为UIViewController。然后在UIViewController设置按钮/控件,并执行操作以关闭UIViewController

- (IBAction)dismiss:(id)sender
{
    [self.presentingViewController dismissViewControllerAnimated:YES
                                                      completion:nil];
}