Xcode:在我添加带有约束的Label后,ViewController中的导航栏便消失了

图片:

Currently there are two 20px Safe Area constraints applied to my Label, both on the left and right.

As soon as I apply a 20px Navigation Bar constraint to the top…

…the Navigation Bar disappears.

没有编写代码。我正在使用最新的Xcode版本。我究竟做错了什么?

评论
ofbgg
ofbgg

部分地,不仅仅是您的问题。 iOS会自动将NavBar放在应用程序顶部。

You should check this answer: Swift iOS Set scrollView constraint below navigation bar programmatically

点赞
评论