开发者

StatusBarHidden not working

开发者 https://www.devze.com 2022-12-18 12:11 出处:网络
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开发者_如何转开发

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!


Did you set wantsFullScreenLayout = YES on your view controller?


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/>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号