Asaf
Asaf

Reputation: 3105

Hide the tab bar in a tab bar application

I have created a new project from the template:

IPhoneOS>Application>Tab Bar Application.

I get two tabs.

How can I make the second become a full screen hiding the tab bar and even the status bar?

I tried to check the "Wants Full screen" - but it didn't help.

(Much less important... When I do get a full screen I do I get back?)

Please give me a simple code/guidelines or a reference to them, cause I'm a beginner - and Me and the compiler got too many issues to make things worse

Thanks Asaf

Upvotes: 9

Views: 26885

Answers (4)

RdPC
RdPC

Reputation: 689

You can just use:

//Navigation bar:
self.navigationController.navigationBarHidden = YES;

//Statusbar:
[[UIApplication sharedApplication] setStatusBarHidden:YES];

//Tabbar:
self.tabBarController.tabBar.hidden = YES;

Upvotes: 20

Josh
Josh

Reputation: 676

Another way to accomplish this is by making the UITabBarController the rootViewController of a UINavigationController. Then when you pushViewControllerAnimated: the tab bar will slide away with the root view controller.

Upvotes: 0

RichardCase
RichardCase

Reputation: 431

To hide the tab bar you can use hidesBottomBarWhenPushed. For instance:

MyController *myController = [[MyController alloc]init]; 
myController.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:myController animated:YES];
[myController release];

To hide the status bar you can use:

[[UIApplication sharedApplication] setStatusBarHidden:YES];

To hide the nav bar you can use:

self.navigationController.navigationBarHidden = YES;

Upvotes: 37

jmont
jmont

Reputation: 423

Have you checked Modal View Controllers out?

http://developer.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/ModalViewControllers/ModalViewControllers.html

Try the presentModalViewController:animated: method on your navigationController (instead of pushing a view controller)

[self.navigationController presentModalViewController:foo animated:YES];

Upvotes: 0

Related Questions