如何在父视图导航栏后面设置页面控制器?

时间:2015-05-05 18:00:27

标签: ios swift uiviewcontroller ios8 xcode6

我有一个管理UIPageController及其子视图的视图。在我的父视图中,我有一个导航栏和底部标签栏。然后在子页面视图中,我缩短了顶部和底部,以便使用此代码显示顶部和底部导航:

self.pageViewController?.view.frame = CGRect(x: 0, y: 65,
            width: self.view.frame.width, height: self.view.frame.size.height - 114)

这使得顶部和底部条形显示如下图所示。但是,我想改变这种方法并使子页面视图全屏,但在顶部和底部条后面“z-indexed”,使其在整个页面图像上变得半透明。这可能吗?

enter image description here

1 个答案:

答案 0 :(得分:0)

您是否尝试过使用topLayoutGuide?这为我的其他childViewControllers修复了它。

override func viewDidLayoutSubviews() {
    someView.contentInset.top = topLayoutGuide.length          // For navigationBar
    someView.contentInset.bottom = bottomLayoutGuide.length    // For toolBar
}
相关问题