[英]NavigationController in swift leads to a black screen
I'm trying to use a navigation controller for an identification process in my swift code but each time I click on a button that leads to it, it shows the following black screen: 我正在尝试将导航控制器用于我的快速代码中的识别过程,但是每次单击指向它的按钮时,它都会显示以下黑屏:
Here is my storyboard if this can helps, there is no warning and no error in the code (using a drag and drop segue or a programmatically one leads to the same black screen) 这是我的故事板,如果有帮助,代码中没有警告,也没有错误(使用拖放功能或以编程方式导致出现黑屏)
Probably the segue
you picked: mode & transition. 您选择的
segue
大概是:模式和过渡。
Are you certain you only have a single segue
? 您确定您只有一个
segue
吗? It is possible to have overlapping segues, which do not show up clearly in Interface Builder. 可能有重叠的序列,这些序列在Interface Builder中无法清楚显示。
Edit 编辑
Is there a way we can see all our segues?
有没有办法看到我们所有的故事?
Segues
are listed at the bottom. Segues
列在底部。 You can inspect Identifier and Segue in the Attribute Inspector. Sounds, I was doing the wrong way (drag a nav controller, delete the table view, add a new View controller and make the segue), but now if I create a view, and then I embed it in a navigation controller it sounds it works ! 听起来,我做错了方法(拖动导航控制器,删除表格视图,添加新的View控制器并进行设置),但是现在如果我创建了一个视图,然后将其嵌入导航控制器中,则听起来不错工程! Anyway, thanks a lot for your help, this definitely helps me !
无论如何,非常感谢您的帮助,这绝对可以帮助我!
I got this when I assigned a custom view to self.view
in viewDidLoad:
. 当我在
viewDidLoad:
中将自定义视图分配给self.view
时,得到了这个。
self.view = self.mapView
Adding mapView as a subview of self.view
solved this. 添加mapView作为
self.view
的子视图解决了此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.