Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITabBar leaves a white rectangle when hidden

Tags:

I have been unable to google an acceptable solution to this that can be applied to my project.

My app is a graphing tool that has three tabs; one for the graph itself and the other two are for browse/search functions for things that can be added to the graph. All tabs are navigation controllers.

The tab for the graph itself, when in portrait mode, displays a small preview of the graph and lists details of each entity that is on the graph below, and displays the tab bar at the bottom.

When the user rotates into landscape mode the graph turns full screen and everything else, including the tab bar, disappears. This is where I'm having the problem, as the GLView for my graph is always obscured by a white rectangle where the tab bar was.

I have tried changing the size of the navigation controllers view to full screen, changing the size of the tab bar controllers' view to full screen, changing the frame size of the tab bar itself to CGRect(0,0,0,0), becoming emotionally distraught, banging my fists on the desk, shouting abusive language at the MacBook, etc; all to no avail.

How can I make it work?

like image 220
Tobster Avatar asked Mar 11 '10 15:03

Tobster


3 Answers

I had this problem, and I've resolved it by changing tabbar's subview frame for my content view (there are 2 subviews in tab bar - content view (#0) and bar view (#1)):

[[self.tabBarController.view.subviews objectAtIndex:0] setFrame:FULLSCREEN_FRAME];
like image 61
reqzix Avatar answered Oct 06 '22 01:10

reqzix


I had the same problem and found the answer here : UIView doesn't resize to full screen when hiding the nav bar & tab bar

just resize the tabbarcontroller view this when you hide the tabbar :

tabBarController.view.frame = CGRectMake(0, 0, 320, 480);
like image 34
Thomas Joulin Avatar answered Oct 06 '22 00:10

Thomas Joulin


It seems to have the problem with hiding the Bottom bar as Tab bar.... which I was facing and googled a lot for this.I consider it as a bug with this tab bar.Then also....we can use some trick.....

You can try for this and will definitely help if you are trying to hide the tab bar and which leaves the white space..

for the hell of coding you need to write just

[self setHidesBottomBarWhenPushed:YES];

when you are pushing to other view,where you don't need the Tab bar just write it

twitDetObj=[[TwitDetail alloc] initWithNibName:@"TwitDetail" bundle:nil];
[self.navigationController pushViewController:twitDetObj animated:YES];
self.hidesBottomBarWhenPushed=YES;
[twitDetObj release];

Hope this will work for you.....

like image 22
Ajay Sharma Avatar answered Oct 06 '22 00:10

Ajay Sharma