【问题标题】:iOS 11 iPhone x navigation bar has a gap between notchiOS 11 iPhone x 导航栏有缺口
【发布时间】:2017-12-13 21:36:47
【问题描述】:

按下评论图标时,它会加载并将 CommentController 推送到导航堆栈。

let storyboard = UIStoryboard(name: "Main", bundle: nil)
    let controller = storyboard.instantiateViewController(withIdentifier: "CommentsVC") as! CommentsController
    controller.post = post
    self.navigationController?.pushViewController(controller, animated: true)

奇怪的是 NavigationBar 在第一个屏幕上是完美的。 HomeFeed(第一个屏幕)使用故事板嵌入到 navigationController 中。

【问题讨论】:

  • 您能强调一下您所说的差距吗?
  • torap,我已经突出显示了图像。我说的是commentController 顶部的黑色间隙。 NavigationBar 不像 homeFeed 屏幕 NavigationBar 那样附加到屏幕顶部。

标签: ios uinavigationcontroller uinavigationbar ios11 iphone-x


【解决方案1】:

这是因为iOS11 iPhoneX中的导航栏没有到达顶部。

您可以通过在您的应用委托中执行 window?.backgroundColor = UIColor.white 将其变为白色。

但是,我建议您查看您的层次结构。在这种情况下不应该发生这种情况。

【讨论】:

    猜你喜欢
    • 2018-03-05
    • 1970-01-01
    • 1970-01-01
    • 2018-02-12
    • 1970-01-01
    • 1970-01-01
    • 2018-03-12
    • 2018-01-03
    • 2018-03-03
    相关资源
    最近更新 更多