导航栏和 table 视图之间的分隔消失

Seperation between navigation bar and table view disappear

我正在创建一个带有导航栏和 table 视图的应用程序。出于某种原因,导航栏在它和 table 视图之间缺少分隔符。在界面生成器中,它看起来像 it does have it. However, when I run my app in the simulator (or on device), the separator disappears. 为什么?

编辑:Here's a better picture of my storyboard as per requested.

导航栏是否设置了阴影图像?像这样:

[[UINavigationBar appearance] setShadowImage:[UIImage imageNamed:@"ShadowImage"]];

如果设置了,请尝试移除。

您必须选择第一个视图控制器,并且您必须从顶部菜单中选择 select Editor -> Embed In -> Navigation Controller这就是将导航控制器添加到视图控制器的方法。

此外,您还必须使用委托将数据从推送的视图控制器传回。