UITableview content overlaps translucent nav bar when scrolled on iOS 13

So, a UItableview inside a *regular* UIViewController (not using UITableviewcontroller).


1) This view controller is embedded in a UINavigationController. The navigation item has "automatic' large title mode.


2) The navigation controller's nav bar prefers large title.


3) When the table view is scrolled, the big title does *not* shrink to the *regular* title size like in the iOS mail app. Instead, the table view content overlaps the navbar and bleeds through, making a UI glitch.


On iOS 12 the scrolled content does not overlap the nav bar. This is new in IOS 13. Anyone get this and have a workaround?

Alright, I think I figured out what seems to be causing this bug.


Underneath the table view, there is a sibling view in the hierarchy. When there is no data for the table view, I simply hide the table view to show the view underneath, which displays something like "No Results."


For whatever reason, the presence of this sibling view throws the navigation bar's attempt to determine whether or not there is a scroll view being used out of whack. If I simply remove the sibling view from the view hierarchy, the navigation bar shrinks to regular size when scrolled as expected.

if I change the constraints of the table view so that its frame is in the safe area, I avoid the overlapping problem when scrolled. This basically makes using a translucent nav bar pointless though, since the table view will clip right at the safe area top edge instead of "bleeding" through the translucent nav bar.

The issue described in this thread seems similar: https://forums.developer.apple.com/thread/122703


Only in this case instead of a popover the content overlaps the navigation bar when scrolled offscreen. If this is an intentional change here too, someone please explain the benefits of this. If I already am using a translucent nav bar why on earth would I manually have to stick a visual effects view in the safe area region manually? What has been accomplished?

I once read this interesting article.


Not sure it may answer your question (it is not addressing a difference from iOS 12 to iOS 13).

But reading it may hint you to a solution ?


h ttps://michiganlabs.com/ios/development/2016/05/31/ios-animating-uitableview-header/

Accepted Answer

Alright, I think I figured out what seems to be causing this bug.


Underneath the table view, there is a sibling view in the hierarchy. When there is no data for the table view, I simply hide the table view to show the view underneath, which displays something like "No Results."


For whatever reason, the presence of this sibling view throws the navigation bar's attempt to determine whether or not there is a scroll view being used out of whack. If I simply remove the sibling view from the view hierarchy, the navigation bar shrinks to regular size when scrolled as expected.

Underneath the table view, there is a sibling view in the hierarchy. When there is no data for the table view, I simply hide the table view to show the view underneath, which displays something like "No Results."


Just for sharing.

I do this differently.

I create a second section in the tableView.

If first section (the only useful one) is empty, then I populate a cell in second section, with title as 'No Results'

Hello Macho im trying to mention u in another post but it seems i cant do that could you please check this post? https://developer.apple.com/forums/thread/706942#reply-to-this-question

Hello Macho im trying to mention u in another post but it seems i cant do that could you please check this post? https://developer.apple.com/forums/thread/706942#reply-to-this-question

UITableview content overlaps translucent nav bar when scrolled on iOS 13
 
 
Q