【问题标题】:Tab Bar not hiding using UIViewController标签栏不使用 UIViewController 隐藏
【发布时间】:2018-01-18 20:18:37
【问题描述】:

我正在使用 Tab Bar 添加 UIViewController 作为 PresentViewController,然后视图如下所示:

选择任何选项后,我需要隐藏标签栏,但我的屏幕看起来像:

请向我提出解决方案。我正在添加一个视图控制器:

self.presentViewController(responseSelector, 动画: true, 完成:无)

【问题讨论】:

  • 你尝试了什么?
  • 你是否在 responseselector v c viewillappear 中设置了 self.tabbarcontroller.tabbar.ishidden = true
  • 是的,我试过但标签栏没有隐藏。但是想要在我的第一个屏幕上显示标签栏,然后当我打开日历时,我想隐藏它。

标签: swift uiviewcontroller uitabbar


【解决方案1】:

我找到了解决办法。

let responseSelector =
 ResponseSelectorViewController(responseId:currentResponse.title,
 delegate:self)
         responseSelector.modalPresentationStyle = .OverCurrentContext
         self.presentViewController(responseSelector, animated: true, completion: nil)

我在其中更改了 1 行代码。

 responseSelector.modalPresentationStyle = .OverFullScreen

【讨论】:

    【解决方案2】:

    我在ViewWillAppear() 函数中使用了以下行:

    self.tabBarController!.tabBar.isHidden = true
    

    而且效果很好。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-10-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-24
      • 2013-09-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多