I want to hide a toolbar and nav bar as I scroll down a page. And return it as I scroll up. How is this possible?
How would I go about detecting the drag? Do I use pan gesture or is this down with the scrollview?
I want to hide a toolbar and nav bar as I scroll down a page. And return it as I scroll up. How is this possible?
How would I go about detecting the drag? Do I use pan gesture or is this down with the scrollview?
You can use these lines of code :
Try this simple approach: Tested in
Swift 3
Output:
Updated
Note: If you passing any data from this VC to another VC that embedded with
navigationController
.You may need tounhide
theNavigationBar
.you can try
self.navigationController?.hidesBarsOnTap = true
in viewDidAppear also you can use hide on swipe.Here is very good option for that
Easily hide and show a view controller's navigationBar/tabBar as a user scrolls https://github.com/tristanhimmelman/HidingNavigationBar
Easily to do this:
Thanks everyone, the way I went with was using AMScrollingController.
https://github.com/andreamazz/AMScrollingNavbar
It's updated for Swift 3