Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/119.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.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 如何在UISplitViewController中使UINavigationBars透明?_Ios_Swift_Uisplitviewcontroller - Fatal编程技术网

Ios 如何在UISplitViewController中使UINavigationBars透明?

Ios 如何在UISplitViewController中使UINavigationBars透明?,ios,swift,uisplitviewcontroller,Ios,Swift,Uisplitviewcontroller,我有UISplitViewController和两个uinavigationcontroller。如何使其透明 我认为它是不透明的,因为一些分割视图控制器栏 最后看起来是这样的: override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() if let potentialBarView = view.subviews.first { if round(potentialBarView

我有
UISplitViewController
和两个
uinavigationcontroller
。如何使其透明

我认为它是不透明的,因为一些分割视图控制器栏

最后看起来是这样的:

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


这不是我需要得到的;)

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

override func viewDidLayoutSubviews() {
    super.viewDidLayoutSubviews()
    if let potentialBarView = view.subviews.first {
        if round(potentialBarView.bounds.height) == 64 {
            potentialBarView.removeFromSuperview()
        }
    }
}
我想知道为什么SplitViewController每次出现时都会生成这样的子视图,也许有人知道,我不知道。但是这个解决方法非常有效。

ha让我们来做吧;)但你需要知道它在横向模式下对iphone不起作用。Bar不等于64;)