1

Everything is in the title, here some things that I tried :

    [[UIApplication sharedApplication] setStatusBarHidden:YES];
[self setWantsFullScreenLayout:YES];
[[self view] setNeedsLayout];
CGRect frame = self.view.frame;
frame.size.height += 20.0;
[[self view] setFrame:frame];

Could you tell me what to do? I thing it might be something else in the code, since with a simple clear project, it's working.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Thomas Joulin
  • 6,590
  • 9
  • 53
  • 88
  • possible duplicate of [UIView doesn't resize to full screen when hiding the nav bar & tab bar](http://stackoverflow.com/questions/1110052/uiview-doesnt-resize-to-full-screen-when-hiding-the-nav-bar-tab-bar) – ProgramFOX Mar 05 '14 at 16:59
  • I found the answer here : http://stackoverflow.com/questions/1110052/uiview-doesnt-resize-to-full-screen-when-hiding-the-nav-bar-tab-bar – Thomas Joulin Oct 25 '10 at 13:16

2 Answers2

0

You probably need to change the position of the frame, as well as its height.

frame.origin.y -= 20.0;
frame.size.height +=20.0;
Ben
  • 2,982
  • 1
  • 16
  • 12
  • nop. I printed the frame to be sure : 0.000000 -20.000000 320.000000 387.000000. My view is in a navigation controller, which is in a tabbarcontroller if that helps – Thomas Joulin Oct 13 '10 at 13:54
  • You may need to adjust the frame of the root controller so the tabbarcontroller it sounds like, then you would need to adjust the size of the navigation controller frame. They would both need to be 0,0,320,480 for full screen. This assumes the tabbar and the navigation bar are subviews of their respective controller main views which I think they are. – Ben Oct 13 '10 at 14:04
  • I did change the tabBarController.view.frame, but it doesnt worked. Moreover, I did change backgrounds and none showed up green. The space left by my status bar is white... – Thomas Joulin Oct 13 '10 at 14:26
  • Thats probably your UIWindow you are seeing as white since its the default window background color. Are you sure the position of the tabbarcontroller main view is 0,0 – Ben Oct 13 '10 at 14:30
0

Did you assign values for following properties of UIView?

  • @property(nonatomic) BOOL autoresizesSubviews
  • @property(nonatomic) UIViewAutoresizing autoresizingMask

I had used Ben's method before for status bar's problem, but I think it should have another elegant way for this.

AechoLiu
  • 17,522
  • 9
  • 100
  • 118
  • I use Interface Builder so I setup the resizing mask manually. Works for other UI elements that gets pushed to top when hidding the status and navigation bar – Thomas Joulin Oct 13 '10 at 14:25