简体   繁体   English

将UITableView隐藏在导航栏下

[英]Hiding UITableView Under Navigation Bar

I have a custom view for the Navigation Bar which displays title and subtitle. 我有一个导航栏的自定义视图,其中显示标题和副标题。 When I scroll I hide the NavigationBar using the "Hides Bar on Swipe" property. 滚动时,我使用“滑动时隐藏栏”属性隐藏了NavigationBar。

Unfortunately, my UITableView still extends to the full screen as shown below: 不幸的是,我的UITableView仍然扩展到全屏,如下所示: 在此处输入图片说明

I played around with different properties on UINavigationController in Storyboard 我在Storyboard的UINavigationController上使用了不同的属性

Under Top Bars - unchecked  
Under Bottom Bars - unchecked 

UINavigationController Storyboard Settings: UINavigationController故事板设置:

在此处输入图片说明

MyTableViewController Storyboard Settings: MyTableViewController故事板设置:

在此处输入图片说明

What am I missing? 我想念什么?

请删除显示导航栏上的刻度线。

This is correct and expected behavior. 这是正确的和预期的行为。 This is exactly why you should not hide the navigation bar; 这就是为什么你应该隐藏导航栏; you need it to provide a cover for your table view on “notched” devices. 您需要使用它来为“缺口”设备上的表格视图提供封面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM