-1

iOS7 上的状态栏行为不一致。有时它显示如下: 在此处输入图像描述

虽然有时视图显示为:

在此处输入图像描述

我的行为如第一张图片所示。

4

2 回答 2

1

在您的 viewdidload 中添加此代码

if ([self respondsToSelector:@selector(setEdgesForExtendedLayout:)])
{
    self.edgesForExtendedLayout = UIRectEdgeNone;
}
于 2013-10-04T10:31:40.203 回答
-1

This will work if you are not using navigation controller

Add this code in didFinishLaunchingWithOptions method

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7)
{

    [application setStatusBarStyle:UIStatusBarStyleLightContent];

    self.window.clipsToBounds =YES;

    self.window.frame =      CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20);
}

Make changes in your plist add View controller-based status bar appearance enter image description here

于 2013-10-04T11:37:17.827 回答