简体   繁体   中英

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

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;
self.tabBarController?.navigationController?.navigationBar.hidden = true

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM