On NavBar Swipe Hide, HeaderCell creates a Transpa

2019-06-07 08:21发布

问题:

I have a Header Cell and Content Cell.. Also, I have a NavBar that

-- Status Bar --
 --  NavBar --
-  Header Cell - 
-- Content Cells - 

Until now, everything seems fine. Then I turned on Hide NavBar on Swipe. Everything was working perfect until Content Cells' views appear for a blink of an eye above the Header Cell. I gave Status Bar and Header Cell color to understand what was exactly causing the problem.

I couldn't take a clear picture but the problem is: Header Cell takes a while to get attached to the status bar, so it gives a transparent gap. This transparent gap unfortunately shows Content View cells' text as well.

This was UITableViewController


I also tried creating a ViewController and embedding TableView from UITableViewController and giving constraints..

Everything seemed fine at first but after NavBar gets hidden, it gives a default gap that doesn't even go away eventually..

- - ->

回答1:

Unchecked 'Adjust Scroll View Insets' - for quick solution. If it's checked, the gap occurs.

But at this point, I tried to hide NavigationBar on swipe. I couldn't manage to succeed on it with TableViewController, so I moved my TableView (from TVC) to a new ViewController. For complete workaround, please check detailed answer...