Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 715
Jugs Avatar asked Aug 03 '10 14:08

Jugs


2 Answers

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;
like image 174
joelm Avatar answered Oct 01 '22 16:10

joelm


self.tabBarController?.navigationController?.navigationBar.hidden = true
like image 42
iSekhar Avatar answered Oct 01 '22 16:10

iSekhar