【问题标题】:Swift - Black Bottom Bar when Pushing to a New ViewControllerSwift - 推送到新 ViewController 时的黑色底栏
【发布时间】:2019-04-24 12:53:43
【问题描述】:

当我推送到一个新的视图控制器时,我得到了这个:

在故事板中,我没有将 hidesBottomBarWhenPushed 设置为 true。 在上图所示的“更多”视图中,我有这个,其中PostsController 是图像中的“喜欢”视图:

let destinationVC = segue.destination as! PostsController
destinationVC.hidesBottomBarWhenPushed = true

此外,“更多”视图中还有一个底部标签栏。

我应该怎么做才能去除这个黑色空间? 谢谢!

【问题讨论】:

  • 这个问题只在 iPhone X 设备上吗?

标签: ios swift


【解决方案1】:

你可以把它放在你的 PostsController 中而不是在 segue 中

override var hidesBottomBarWhenPushed: Bool {
    get {
        return true
    }
    set {
        self.hidesBottomBarWhenPushed = newValue
    }
}

【讨论】:

  • 还是不行。而且在 PostsController 中,我需要使用if 来检查它是否是那种类型的 PostsController。如果是页面Likes,那么我将其隐藏。否则,我不会。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2023-03-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多