1
- (void)viewWillAppear:(BOOL)animated {

[[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];

[navigationController setNavigationBarHidden:YES animated:YES];
}

The above code works perfectly fine and when the view is about to appear, a nice animation begins and after that, both the status bar and navigation bar are hidden.

BUT! My 320x480 view is not moved up to the top (0,0) as I want it to, but it is moved to where the navigation bar was, UNDER the (hidden) status bar. Where the status bar was, is blank, and the bottom of my view is cut off from the window. I find this rather strange because as you can see, I am using a UINavigationController to switch views and I am hiding the navigation bar as well, and the view does move 44px up, compensating the disappearing of the navigation bar. It just doesn't take the height of the status bar into account.

Same problem is on my camera view controller: a view in which camera is opening but view is not from top

Any one have idea how to fix this problem ?

Oded
  • 489,969
  • 99
  • 883
  • 1,009
user145883
  • 227
  • 1
  • 7
  • 20

2 Answers2

1

Check out this post. I have done this several times. You should be all set.

How to set the top position = 0 after setStatusBarHidden:Yes?

Community
  • 1
  • 1
MystikSpiral
  • 5,018
  • 27
  • 22
0

The Code is:

Just a View:

[self.view setFrame: [self.view bounds]];

A view with a scroll view inside

[self.view setFrame: [self.view bounds]];
[self.theScroller setFrame: [self.view bounds]];

"theScroller is the name of my scrollview

mikemike396
  • 2,435
  • 1
  • 26
  • 41