如何修复 ios 7 中的状态栏重叠问题 [英] how to fix status bar overlap issue in ios 7

查看:18
本文介绍了如何修复 ios 7 中的状态栏重叠问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个在 IOS6 中运行良好的应用程序.但在 iOS7 中,状态栏与视图重叠.

I am developing an application that's working fine in IOS6. But in iOS7, the status bar overlaps with the view.

举个例子:

我首先需要状态栏,然后然后我的图标和删除最后一个.所以请告诉我如何删除重叠的任何想法.

I need the status bar first, and then my icons and Remove last .So Please give me any idea about how to remove the overlap.

但我需要这个

请告诉我有关我的问题的任何想法

Please give me any idea about my problem

推荐答案

 -(void)viewWillLayoutSubviews{

 if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) 
  {
    self.view.clipsToBounds = YES;
    CGRect screenRect = [[UIScreen mainScreen] bounds];
    CGFloat screenHeight = 0.0;
    if(UIDeviceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation]))
        screenHeight = screenRect.size.height;
    else
        screenHeight = screenRect.size.width;
    CGRect screenFrame = CGRectMake(0, 20, self.view.frame.size.width,screenHeight-20);
    CGRect viewFr = [self.view convertRect:self.view.frame toView:nil];
    if (!CGRectEqualToRect(screenFrame, viewFr))
    {
        self.view.frame = screenFrame;
        self.view.bounds = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
    }
  }
}

这篇关于如何修复 ios 7 中的状态栏重叠问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆