andreamazz / AMScrollingNavbar

Scrollable UINavigationBar that follows the scrolling of a UIScrollView
MIT License
6.05k stars 634 forks source link

How to remove white spaces under Header when scrolling up ? #361

Closed X901 closed 5 years ago

X901 commented 5 years ago

After Adding Header when scrolling up it see white space

on TapviewCoontroller I make the tableview under it that fixed the issue

but on header, I can't go with this way because user won't see the cells

my code is

if let navigationController = self.navigationController as? ScrollingNavigationController , let tabBarController = self.tabBarController {
  navigationController.followScrollView(tableViewLifeCycleAttachmentsData, delay: 0.0, followers: [NavigationBarFollower(view: topView , direction: .scrollUp),NavigationBarFollower(view: attachmentsButton , direction: .scrollUp) ,NavigationBarFollower(view: tabBarController.tabBar, direction: .scrollDown) ])
  navigationController.scrollingNavbarDelegate = self
}

see this image https://cl.ly/d533118ac970

andreamazz commented 5 years ago

Hey @X901 I'm not sure I understand the issue, can you provide a sample to test?

X901 commented 5 years ago

First, I did try to hide the Header completely but doesn't work for me

then I accept it as its but the white space is very annoying

this an Example Demo exactly like what I faced
https://cl.ly/6224f8b81636

I did change the color of the tableview to make the white space noticeable

I know that the white space is from Super View but I don't know how to make the table view above it

andreamazz commented 5 years ago

You should set a constraint on the top guide for the table, then inset its content, check this: https://d.pr/f/sBYtEQ

X901 commented 5 years ago

Thank you very much !