简体   繁体   中英

swift iOS resize view on scroll

I have a VC with a navigation bar and then a uiview under it that acts as an extension to the navbar.

Then I have a embedded table view.

What I would like to do is to add a scroll recogniser to the container view that holds the table view so when I scroll down the uiview under the navigation bar should be hidden.

Is this possible? I have used self.navigationController?.setNavigationBarHidden(true, animated: true) In order to hide the navigation bar and that works. The problem is that I now need to hide the uiview under it. And I can't get it to work/feel smooth since just a hide/show functions looks strange. I would like it to be hidden the same speed as I scroll

iOS 8 has advaced functionality for such effects already buildin. See here: http://natashatherobot.com/navigation-bar-interactions-ios8/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM