【问题标题】:Navigation Viewcontroller not showing back button导航视图控制器不显示后退按钮
【发布时间】:2014-08-01 23:30:31
【问题描述】:

在这里,让我将 viewcontroller 作为 vc.. 使用导航控制器从 vc1 移动到 vc2。从 vc2 到 vc3 我正在以编程方式移动,使用模态。我再次以编程方式返回到 vc2。但是在这里我的导航栏后退按钮在 vc2 中消失了,我无法从 vc2 移回 vc1。导航栏后退按钮在进入 vc3 之前起作用,我的意思是我可以在 vc1 和 vc2 之间多次往返,但是如果我一旦进入 vc3... 我可以回到 vc2 并且从那里我不能回去到vc1。

vc2 到 vc3....

VC3 *vc3 = [self.storyboard instantiateViewControllerWithIdentifier:@"VC3"];
[self presentModalViewController:vc3 animated:YES];

vc3 到 vc2.....

VC2 *vc2 = [self.storyboard instantiateViewControllerWithIdentifier:@"VC2"];
[self presentModalViewController:vc2 animated:YES];

【问题讨论】:

    标签: ios objective-c uiviewcontroller uinavigationcontroller


    【解决方案1】:

    从“vc3 到 vc2”,你需要作为解除视图控制器vc3。将你的 vc3 代码替换为 vc2.....

    [self dismissModalViewControllerAnimated:YES];
    

    在您的代码中,您再次在 vc3 上显示 vc2,而不是关闭 v3

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-06-22
      • 1970-01-01
      • 2014-02-16
      • 2011-03-26
      • 1970-01-01
      • 1970-01-01
      • 2012-01-01
      相关资源
      最近更新 更多