1

I've been trying to get a section of my TabBarController to go fullscreen for a while but still can't figure out this 1 last piece.

So I'm able to put the UIViewController behind UINavigationBar using the code below.

self.navigationController.navigationBar.translucent = YES;
self.wantsFullScreenLayout = YES;

Also able to hide the UINavigationBar & TabBarController using the code below.

[self.navigationController setNavigationBarHidden:YES animated:NO];
[self.tabBarController.tabBar setHidden:YES];

However, my UIViewController's height still wouldn't extend behind where the TabBarController is before I hide it. So it looks as though there is a blank space below.
Image attached.

enter image description here

I tried changing self.tabBarController.view.frame and bound. Still doesn't do it. Seems like something is preventing it to cover that bottom portion.

How can I achieve that?

Thank you,
Tee

Ryan
  • 16,626
  • 2
  • 23
  • 20
teepusink
  • 27,444
  • 37
  • 107
  • 147

1 Answers1

1

UITabBarController is not designed to allow its subview to go "behind" the tab bar, probably because a tab bar cannot be translucent. And although [self.tabBarController.tabBar setHidden:YES] does hide the tab bar, it doesn't tell the UITabBarController to lay out your view in the space that is normally occupied by the tab bar. In fact, there is no really supported way to do this.

OTOH, it is easy enough to reposition the tab bar manually if you are willing to risk things breaking in a future version of iOS. The UITabBarController's view has two subviews: one is the tab bar, and the other is the content view (which contains the view from the currently active view controller). Just resize the content view to occupy the space; you could even animate the tab bar moving off the bottom of the screen if you'd like.

Anomie
  • 92,546
  • 13
  • 126
  • 145
  • Thanks Anomie, your answer point me to the solution here http://stackoverflow.com/questions/5272290/how-to-hide-uitabbarcontroller – teepusink Aug 09 '11 at 21:28