Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/hadoop/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何在父视图导航栏后面设置页面控制器?_Ios_Swift_Uiviewcontroller_Ios8_Xcode6 - Fatal编程技术网

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

Ios 如何在父视图导航栏后面设置页面控制器?,ios,swift,uiviewcontroller,ios8,xcode6,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) 这会使顶部和底部栏显示

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

self.pageViewController?.view.frame = CGRect(x: 0, y: 65,
            width: self.view.frame.width, height: self.view.frame.size.height - 114)
这会使顶部和底部栏显示为下图所示。但是,我想改变这种方法,使子页面视图全屏显示,但在顶部和底部栏后面显示“z索引”,使其在整个页面图像上变为半透明。这可能吗


您是否尝试过使用
topLayoutGuide
?这为我的其他孩子解决了这个问题

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

要管理pageViewController的框架,最好使用约束(在本例中为topLayoutGuide和bottomLayoutGuide)。使导航栏透明:希望这有助于这是一个好主意,但不幸的是,这禁用了视图上的所有约束,包括标签、图像等。此时我唯一能想到的是设置父视图的背景图像。这是调整子视图的大小,但不更改导航栏和底部栏的z索引。除非我在错误的地方做这件事(我在子视图中做的)。