Is there a way to hide tabbar and remove that space left (around 50px) ?
I tried
self.tabBarController?.tabBar.hidden = true
self.extendedLayoutIncludesOpaqueBars = true
No luck. I see blank space.
Is there a way to hide tabbar and remove that space left (around 50px) ?
I tried
self.tabBarController?.tabBar.hidden = true
self.extendedLayoutIncludesOpaqueBars = true
No luck. I see blank space.
For those that like to do everything programmatically, add this line to the
init
method of aViewController
that shouldn't have the tabBar:My preferred way to do that is using a wrapping controller. If I want to hide the tab bar, I just increase the height of the tab bar controller, thus effectively the tab bar is moved out of the screen.
With this solution you don't need to hack tab bar frame and you don't depend on navigation controller push animation:
Swift 3:
To use (if for example
self
is aUITabBarController
):Swift 2.x:
To use:
Programmatically, add this to the next view controller for swift 4.
And add a background color
You can refer this link - iOS/Swift - Hide/Show UITabBarController when scrolling down/up. For better Result Do not forget to add this line of code in your viewdidLoad() for Black screen removal after hiding Tab bar.
For me in iOS 13 I had to display image in cell with full screen, I had collection view with
trailing, leading, top, bottom
constraint. I removed all constraint. set collection view frame toUIScreen.main.bounds
. then returnsizeForItemAt
as collection frame size.