On NavBar Swipe Hide, HeaderCell creates a Transparent Gap and Content Appears Through

半城伤御伤魂 提交于 2019-12-08 08:34:39

问题


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...



来源:https://stackoverflow.com/questions/36510974/on-navbar-swipe-hide-headercell-creates-a-transparent-gap-and-content-appears-t

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!