Hide UITabBar with standard way

Hide UITabBar with standard way(The article written in Japanese is here.)

I wanted to make the slide-in menu view like Google+ app. But it was difficult. I searched and tried the way on the site, I couldn’t do it at the end of 2 hours work. To say the truth, I could but it didn’t seem a good way. I didn’t want to access the private views or write frame directly.

At last, I found the best way with the combination of standard apis – when I see the document. I’ll show you that below(I tested only with UIStoryboard and iOS6.0 and later. But you can do it with other environment if iOS 2.0 and later, I think).My way

  1. Add UITabBarController to UIStoryboard
  2. Designate UINavigationController to viewControllers of UITabBarControllerのviewControllers
  3. Check the Hides Bottom Bar on Push of rootViewController of UINavigationController

That’s it. I explain respectively.

1. Add UITabBarController to UIStoryboard

No need to explain, isn’t it.

2. Designate UINavigationController to viewControllers of UITabBarControllerのviewControllers

Storyboard

Buttons are for testing to change viewControllers of UITabBarController. The code is below.

- (IBAction)buttonTapped:(UIButton *)sender {
    self.tabBarController.selectedIndex = 1;
}

3. Check the Hides Bottom Bar on Push of rootViewController of UINavigationController

Property

Easy.

See my code with Github.

And,

  • If you interested this article, please download my app. And review about it. -> my app

Pocket
LINEで送る

You may also like...