9

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

Asaf
  • 3,067
  • 11
  • 35
  • 54

4 Answers4

37

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;
RichardCase
  • 431
  • 3
  • 3
  • 3
    myController.hidesBottomBarWhenPushed = YES; works when I move from a table view to the view... Is it possible to load the first view (of the tab bar) without showing the bar... where do I put the code? – Asaf Jul 15 '10 at 07:16
20

You can just use:

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

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

//Tabbar:
self.tabBarController.tabBar.hidden = YES;
RdPC
  • 671
  • 10
  • 17
  • In case you're using tabbar with navigation controller `hidesBottomBarWhenPushed` will not work, but `tabBarController.tabBar.hidden` will do. – Ratata Tata Jan 12 '15 at 18:15
  • I'm having trouble hiding the bottom bar when using RBStoryboardLink. Neither approach seems to work :( – fatuhoku Feb 12 '15 at 16:12
0

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];
jmont
  • 423
  • 3
  • 12
  • I'm building a simple game at the main view and the setting grouped in the rest of the tab bar ... It's really hard for me to understand the navigation here... so building a tab bar in a modal view... if possible... seems too hard at the moment thanks – Asaf Jul 15 '10 at 07:20
0

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.

Josh
  • 621
  • 6
  • 10