Closed roshanman closed 7 years ago
@roshanman sorry for late response. Yes, look for "hideBar" method which is hiding the navigation bar on swipe
Thanks, I have noticed the method hideBar
func hideBar(notification: NSNotification) {
let state = notification.object as! Bool
self.navigationController?.setNavigationBarHidden(state, animated: true)
}
In this method, we just hide the navigationbar, I don't understand why when we hide the navigationbar, the tabbar go to the top position automatic.
Thank you.
it's done automatically by iOS. Once you hide the navbar, everything inside the main view goes up with animation.
Why my button do not moved when i hide the navbar ?
Hey @roshanman that's a good question. It depends how you build UI. If your constrains linked with NavBar then it will animate up, otherwise it will not move. Check the attachment. navBar.zip
Thanks for your help. This method worked.
But in your code
lazy var tabBar: TabBar = {
let tb = TabBar.init(frame: CGRect.init(x: 0, y: 0, width: globalVariables.width, height: 64))
tb.delegate = self
return tb
}()
//TabBar
self.view.addSubview(self.tabBar)
you do have not used constrains for tabbar. really strange!
@roshanman yeah, it was a bad decision. In upcoming update will replace InitWithFrames with constrains
Why when we hide the navigationbar, the tabbar go to the top automatic?