0

Stumped on this one. I am using a section of code posted here to rotate a view into landscape. Rotate, sizing and animations are working great, but when the view rotates, the status bar hangs around as a thin gray strip, which is the same size as the hidden status bar.

Here is the code:

[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:1.25];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];

[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];         
if (self.interfaceOrientation == UIInterfaceOrientationPortrait) {      
        self.view.transform = CGAffineTransformIdentity;
        self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(90));
        self.view.bounds = CGRectMake(0.0, 0.0, 480, 320);
}
[UIView commitAnimations];

Thanks in advance!

Rob Bonner
  • 9,276
  • 8
  • 35
  • 55
  • Any updates on this? Seems like iOS 7 has a different approach: http://stackoverflow.com/a/18957926/1049134 – Rivera Feb 26 '14 at 08:57

2 Answers2

1

Did you set wantsFullScreenLayout = YES on your view controller?

Ole Begemann
  • 135,006
  • 31
  • 278
  • 256
0

iOS7: I added the following code to the Info.plist to get rid of the status bar permanently. Found it in another stackexchange question.

<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
cat
  • 2,871
  • 1
  • 23
  • 28