iOS 7状态栏重叠问题

时间:2013-12-11 11:57:22

标签: ios iphone ios7

我尝试了以下建议的解决方案,它确实将屏幕向下移动,但状态栏变为不可见(黑色)。我也尝试在info.plist中关闭基于视图控制器的状态栏样式,然后在AppDelegate中设置setStatusBarStyle,但没有运气,我怎样才能显示状态栏,请帮助..

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
    [[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleLightContent];
    self.window.clipsToBounds =YES;
    self.window.frame = CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20);
    self.window.bounds = CGRectMake(0,0, self.window.frame.size.width,      self.window.frame.size.height);
}

1 个答案:

答案 0 :(得分:1)

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
       [[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleLightContent];
       self.window.clipsToBounds =YES;
       self.window.frame = CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20);
}
else{
       self.window.frame = CGRectMake(0,0, self.window.frame.size.width, self.window.frame.size.height);
}

请尝试使用此功能。