Hiding Navigation bar with self.navigationController.hidesBarsOnSwipe = true, hides it permanently

ぃ、小莉子 提交于 2019-12-11 23:47:25

问题


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?


回答1:


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




回答2:


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.




回答3:


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



来源:https://stackoverflow.com/questions/40019359/hiding-navigation-bar-with-self-navigationcontroller-hidesbarsonswipe-true-hi

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