views:

493

answers:

9

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?

A: 

Have you tried hiding the UITabBar with

tab_bar.hidden = YES
Tuomas Pelkonen
That's what I'm doing to hide the tab bar, which successfully disappears; but leaves a white rectangle where it was.
Tobster
A: 

Are you sure it's obscured and not just A) not redrawn or B) the frame of your GLView doesn't occupy that space?

Steven Canfield
I would say it more or less appears to not occupy the space rather than be obscured by it, however graph.superview.frame = CGRect(0,0,480,320) does not work, neither does the same with self.view, self.superview, just about any other combination.
Tobster
A: 

I have the same problem. In my case I have an UIImageView in a UIScrollView. I want it to appear fullscreen like the photo app and have the tab bar disappear. I can get it to disappear, but i cannot get it to resize properly. The area where the tab bar was is not drawn. It appears as a white rectangle.

I've tried to debug frame sizes. Up the hierarchy a see a UIViewControllerWrapperView. This is the object that does NOT resize no matter how large I make the child views. I've tried setting requests full screen. I've tried setting all sorts of sizes and resizing options all to no avail. Any ideas appreciated.

I also posted a question on stackoverflow at http://stackoverflow.com/questions/3586869/how-to-make-controls-fade-away-on-ipad-iphone-as-per-interface-guidelines and also posted a question http://stackoverflow.com/questions/3596015/how-to-resize-uiviewcontrollerwrapperview

David
A: 

some of the superviews of currentViewController.view of the tab bar view controller has clipToBounds set to YES (it's class name is UITransitionView, if not mistaken). To access it use

tabBarController.currentViewController.view.superview.superview.clipToBounds = NO;

after doing this your attempts of resizing a view will not be limited by anything and will succeed. Good luck!

Denis
A: 

This is just a workaround, but have you tried presenting the graph modally when the user rotates to landscape? This should obscure the tab bar.

You can avoid the transition with

[viewController presentModalViewController:graph animated:NO]

kevboh
A: 

I'm assuming that you've already checked the autoresizing arrows on your view?

Owen Hartnett
A: 

its because the space where tab bar was , not allocated to other views when u set tab bar hidden u can set the corresponding view to stretch or fill the whole screen like scale fill or aspect fill something like that or take a view bigger than the iphine screen so that when u change the phone to landscape it can complete fill the screen

pankaj kainthla
A: 

Check the UIView underneath. It may be set to white, so when you hide the tab you're revealing the white UIView. Try setting the UIView to Transparent.

Ryan Garcia
A: 

I think u need to set self.navigationController.view.frame to full size ie to UIApplication screen frame before u set tabbar hidden

NaveenShan