Iphone 状态栏不工作

Iphone 状态栏不工作,iphone,Iphone,在这件事上难倒了。我正在使用这里发布的一段代码将视图旋转到风景中。旋转、调整大小和动画效果都很好,但是当视图旋转时,状态栏会像一条灰色的细条一样挂起,与隐藏状态栏的大小相同 代码如下: [UIView beginAnimations:@"View Flip" context:nil]; [UIView setAnimationDuration:1.25]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [[UIApplica

在这件事上难倒了。我正在使用这里发布的一段代码将视图旋转到风景中。旋转、调整大小和动画效果都很好,但是当视图旋转时,状态栏会像一条灰色的细条一样挂起,与隐藏状态栏的大小相同

代码如下:

[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];

提前谢谢

您是否在视图控制器上设置了
WantFullScreenLayout=YES

iOS7:我将以下代码添加到Info.plist以永久删除状态栏。在另一个stackexchange问题中找到它

<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
UIStatusBarHidden
UIViewControllerBasedStatusBarAppearance

试一试,没有效果。在我分配控制器后,在加载和显示中尝试了它。对此有任何更新吗?似乎iOS 7采用了不同的方法: