导航栏与旋转设备上的状态栏重叠

时间:2014-04-07 11:28:31

标签: ios7 ios6 compatibility

你好状态栏与导航栏重叠。虽然当我旋转导航栏和状态栏重叠我加载屏幕时我能够正确显示我试图设置所有这些属性

if([[[UIDevice currentDevice] systemVersion]floatValue ] >= 7.0)
{
        self.extendedLayoutIncludesOpaqueBars = NO;
        self.automaticallyAdjustsScrollViewInsets = NO;

        self.navigationController.navigationBar.translucent=NO;
        self.edgesForExtendedLayout = UIRectEdgeAll;
}

1 个答案:

答案 0 :(得分:0)

If you're not using storyboard, then you can use this code in your AppDelegate.m in did finishlaunching:

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);
}