呈现视图控制器显示其下的导航控制器

时间:2017-01-14 08:31:18

标签: ios swift

我目前有标签栏控制器。从其中一个标签中我提供了一个像这样的控制器:

present(vc1, animated: true, completion: nil)

现在,此视图控制器覆盖了标签栏控制器。从这个控制器我现在想要呈现另一个控制器。我再次使用

present(vc2, animated: true, completion: nil)

我也在vc1中设置了self.definesPresentationContext = true

此控制器不是全屏尺寸(它是一个对话框),它不会在下方显示vc1。相反,它显示标签栏控制器。当我解雇它时,再次显示vc1。我在这做错了什么?我想从v1出现并在标签栏控制器下方显示vc1。

1 个答案:

答案 0 :(得分:1)

设置

vc2.modalPresentationStyle = .overCurrentContext
vc2.view.backgroundColor = .clear

之前present(vc2, animated: true, completion: nil)