[英]iOS: table view's title bar covered by navigation bar unexpectedly
I'm developing a simple UI for an iOS app. 我正在为iOS应用开发一个简单的UI。 what I've done is I developed it into a table view which has a navigation controller associated to it and had it laid out in Storyboard. 我要做的是将其开发为表格视图,该表格视图具有与之关联的导航控制器,并将其布置在情节提要中。
Everything seems working fine, except the navigation bar accidentally cover the view's title bar "Click to select item" as shown in the pictures below. 一切似乎工作正常,除了导航栏意外覆盖视图的标题栏“单击以选择项目”,如下图所示。
what do i do to get completely rid of this? 我该怎么做才能完全摆脱这种情况?
In Interface Builder, select your view controller and on the attributes inspector turn off Layout: Wants Full Screen. 在Interface Builder中,选择视图控制器,然后在属性检查器上关闭Layout:Wants Full Screen。 Then, your layout will automatically adjust its size to make room for the navigation bar. 然后,您的布局将自动调整其大小以为导航栏腾出空间。
Add this code in your viewDidLoad method 将此代码添加到您的viewDidLoad方法中
self.navigationController?.navigationBar.translucent = false
It works for me, since you've the same problem with me, I think it's work for you as well. 它对我有用,因为您对我也有同样的问题,所以我认为对您也一样。
您要隐藏导航栏的位置使用此行
self.navigationController.hidden = YES;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.