Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

blank space on the view when hiding uitabbar

I know there are other posts about this issue, but they don't seem to work for me. When a particular view is pushed by my uinavigationcontroller in my app, I rotate the view to landscape mode and hide the tabbar. however, when the tabbar hides instead of displaying the view behind it displays a blank white space.

enter image description here

To solve this I used the following line of code in my viewDidLoad method as suggested by other posts about this issue, but it didn't solve it.

[self.view setFrame:CGRectMake(0.0f, 0.0f, 320.0f, 480.0f)];

If anyone knows what's going on, please help. Thanks,

like image 584
Mona Avatar asked Feb 20 '12 02:02

Mona


1 Answers

You should set setAutoresizingMask: in your view (whether in nib or code) to UIViewAutoresizingFlexibleHeight or UIViewAutoresizingFlexibleBottomMargin (don't sure which one) that should do the trick. In case this donesn't solved your problem I guess that you hide the tabbar by using setHidden:. Try calling this instead.

VIEW_CONTROLLER_THAT_ABOUT_TO_SHOW.hidesBottomBarWhenPushed = YES
[navigationController pushViewController: VIEW_CONTROLLER_THAT_ABOUT_TO_SHOW animated: YES];
like image 150
sarunw Avatar answered Sep 23 '22 06:09

sarunw