iOS7 上的状态栏行为不一致。有时它显示如下:
虽然有时视图显示为:
我的行为如第一张图片所示。
在您的 viewdidload 中添加此代码
if ([self respondsToSelector:@selector(setEdgesForExtendedLayout:)])
{
self.edgesForExtendedLayout = UIRectEdgeNone;
}
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