0

I have a UITableView object in my view controller and I added the following code inside viewDidAppear::

self.navigationController.hidesBarsOnSwipe = true

The navigation bar is hiding when I scroll up, but when I scroll down it's not coming back.

Do I need to do something else?

Pedro Mancheno
  • 5,237
  • 4
  • 24
  • 31
Ajay Kumar
  • 1,807
  • 18
  • 27

3 Answers3

4

By default storyboard add tableview top constraint to "Top Layout Guide.Bottom", you need to change the tableview.top constraint to "View.Top"

enter image description here

Suhit Patil
  • 11,748
  • 3
  • 50
  • 60
  • 1
    It worked, for others who would need how to add contraints to superview follow this link @ http://stackoverflow.com/questions/28766210/autolayout-add-constraint-to-superview-and-not-top-layout-guide – Ajay Kumar Oct 13 '16 at 14:50
1

check your constraints for tableview. It's top constraint should be pin with superview's top not with the toplayoutguide's top. I think you have set constraint with toplayoutguide. So, try to change it with superview's top and your issue will be solved.

Ketan Parmar
  • 27,092
  • 9
  • 50
  • 75
0

I think you need to uncheck Extended edges- under top bars to align your UITableView with topLayourGuide. Refer the attachment.enter image description here

Annie Gupta
  • 2,786
  • 15
  • 23