Ok, real basic tutorial this time.
One line of code! Literally.
And the magic line of code is…
1 2 3 4 5 6 | MyViewController *controller = [[[MyViewController alloc] init] autorelease]; // This is the line! :) controller.hidesBottomBarWhenPushed = YES; [self.navigationController pushViewController:controller animated:YES]; |
That’s all you need
.
That’s fine and all if you’re a coder, but not all of us go tap-tap on keyboards each and every day (and especially night!), whilst sucking down on cans of cola (really bad for your teeth by the way) and chomping down on pizza as we stare like zombies at our screens.
Ah, fun times
…
Anyways, I’ve also put together a video tutorial that’ll show you an example Dapp exported project and the steps to find the exact spot to put our little line of code that hides our tab bar
.
Check it out.
To your app success!,Cliff
P.S. Technology is only a small part of your app success. There is the business, sales and marketing that you need to think of too :). Which is why I also provide a bunch of free education on how to succeed on the App Store - http://kerofrog.com :).
4 Responses to “How to hide the Tab Bar in iOS”
Leave a Reply
Categories
- Admin (7)
- Dapp iPhone SDK Tutorials (19)
- Issues (8)
- Kerofrog (1)
- News (20)
- Personal (1)
- Screenshots (6)
- Updates (16)
-
Recent Posts
Archives
Tags
actions AR Augmented Reality Basic RSS Reader Bug Reports Dapp Dapp HD Dapp Project Dapp Sale Dapp Update Documentation events FAQ guidelines International Settings iPad Mockups iPhone 4 iPhone Code Generator iPhone programming tutorial iPhone SDK Tutorial iPhone Simulator iPhone UI Design Issues Layar Player SDK live preview Mockups Movement Handles PDF Wireframes Prototypes Requirements Tab Bar Controller UI Actions UI Events UINavigationBar UINavigationController UIScrollView UIScrollView Tutorial UISwitch isOn Setting Change 4.2 UITabBarController UITableView Updates View Xcode 3.2.2 Xcode 3.2.3 Beta Xcode 4Links

more interesting question is how to hide tabbar without using navigation controller
self.tabBarController.tabBar.hidden = YES;
You could put that in the init method for your view controller or you can create a – (void)viewWillAppear {} method to place it in.
Or if you want to animate a fade out, create a – (void)viewDidAppear {} method and put the following in:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelegate:nil];
[UIView setAnimationDuration:1.0];
[self.tabBarController.tabBar setAlpha:0.0];
[UIView commitAnimations];
Unfortunately, this will leave a tabBar-shaped area at the bottom of the screen with nothing in it, even if you animate other views to expand into this space.
Oops, hmm… my bad.
Correct thing to use is the ‘hidesBottomBarWhenPushed’ method. *bonk*
Tutorial on this here:
http://stackoverflow.com/questions/3252664/hide-the-tab-bar-in-a-tab-bar-application