Jugs Jugs - 1 month ago 13
Objective-C Question

Hide the top bar in UITabBarController

How do I hide the top bar in UITabBarController using OBJ-C code (without using Interface Builder) ?

Please see the image in the link below to better understand my requirement.

http://skitch.com/jugsvn/dxkr7/iphone-simulator

I already have another toolbar as you can see and I don't want this. I'm not using XIB / NIB files and creating all the objects using plain OBJ-C code.

Cheers
Jugs

Answer

The topBar is part of the UINavigationController not the UITabBarController, you can hide it by putting the following in your viewWillAppear method:

self.navigationController.navigationBarHidden = YES;

But I'm pretty sure the navigationBar is always on top, so I think the bar you want to hide is actually your own toolbar.

self.myToolBar.hidden = YES;
Comments