【问题标题】:How to set custom segue actions through navigation controllers for viewControllers如何通过 viewControllers 的导航控制器设置自定义 segue 操作
【发布时间】:2015-05-21 02:41:28
【问题描述】:

我想让我的应用程序在 CameraViewController 中有自定义按钮;一个推送到 Rustles ViewController(下图中的顶部 VC),另一个转换到 ViewController(底部 VC)。

现在我的应用程序可以通过使用以下方法正确地转到 viewControllers:

-(void)segueToRustlesTableViewController{
if (debug==1) {NSLog(@"Running %@ '%@'", self.class, NSStringFromSelector(_cmd));} // simple debug statement, can ignore

// Instantiate nav controller which segues to table view
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil]; // must assume only IPhone
RustlesTableViewController *rustlesTVC = (RustlesTableViewController *)[storyboard instantiateViewControllerWithIdentifier:@"RustlesView"];
[self performSegueWithIdentifier:@"tableSegue" sender:self];
[self.PickerController presentViewController:rustlesTVC animated:NO completion:nil];
}

但是,当我到达 UIViewControllers 时,我无法转换回旧的 UIViewControllers,大概是因为我没有在每个 UIViewControllers 中嵌入导航控制器。

我现在的代码不适用于 NavigationController,但我真的不知道如何转换到 NavigationController,然后转换到 NavigationController 之后的 UIViewControllers

如何从 CameraViewController 转换到 aNavigationController,然后再转换到 RustlesViewController?

【问题讨论】:

    标签: ios objective-c uiviewcontroller uinavigationcontroller


    【解决方案1】:

    如果您不使用导航控制器,我会在生成的视图控制器(Rustles、View)中创建一个自定义按钮并调用 [self.presentingViewController dismissViewControllerAnimated:YES completion:nil];

    我相信这应该可行。

    【讨论】:

      猜你喜欢
      • 2020-03-20
      • 2015-08-21
      • 1970-01-01
      • 2015-06-22
      • 2016-11-30
      • 2014-01-26
      • 2016-07-25
      • 1970-01-01
      • 2016-06-04
      相关资源
      最近更新 更多