Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide tab bar with animation in iOS?

So I have a button that is connected to a IBAction. When I press the button I want to hide the tab bar in my iOS app with a animation. This [self setTabBarHidden:hidden animated:NO]; or this [self.tabBarController setTabBarHidden:hidden animated:YES]; does not work. This is my code without the animation:

- (IBAction)picture1:(id)sender {     [self.tabBarController.tabBar setHidden:YES]; } 

Any help would be greatly appreciated :D

like image 992
b3rge Avatar asked Jan 05 '14 15:01

b3rge


People also ask

How do I hide the tab bar in iOS?

Simply, Go to ViewController (in StoryBoard) -> Attribute inspector -> Under 'View Controller' section select 'Hide Bottom Bar on Push' checkbox. This works like a charm.

What is tab bar in iOS?

A TabBar is a control that is used to display and configure one or more bar button items in a tab bar for selecting between different subtasks, views, or modes in the iOS application. The TabBar is used in association with the TabBarController to present the list of tabs in the application.


1 Answers

When working with storyboard its easy to setup the View Controller to hide the tabbar on push, on the destination View Controller just select this checkbox:
enter image description here

like image 111
Ben Avatar answered Sep 17 '22 21:09

Ben