代码之家  ›  专栏  ›  技术社区  ›  Bartłomiej Semańczyk

如何在UISplitViewController中使uinavigationbar透明?

  •  1
  • Bartłomiej Semańczyk  · 技术社区  · 8 年前

    我有 UISplitViewController 有两个 UINavigationControllers

    enter image description here

    最后看起来是这样的:

    enter image description here

    这不是我需要的;)

    1 回复  |  直到 8 年前
        1
  •  1
  •   Kamil Walas    8 年前

    如您所见,SplitViewController视图应该包含3个视图:第一个是这个灰色条。所以在SplitViewController子类中,可以执行如下操作:

    override func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()
        if let potentialBarView = view.subviews.first {
            if round(potentialBarView.bounds.height) == 64 {
                potentialBarView.removeFromSuperview()
            }
        }
    }