一 Status bar重叠问题:

方法一:隐藏Status bar   在plist里面增加2个变量  Status bar is initially hidden  -> YES   View controller-based status bar appearance -> NO

方法二:改为和IOS6 一样的显示方式

  1. Set UIViewControllerBasedStatusBarAppearance to NO in info.plist (To opt out of having view controllers adjust the status bar style so that we can set the status bar style by using the UIApplicationstatusBarStyle method.)

  2. In AppDelegate's application:didFinishLaunchingWithOptions, call

    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); //Added on 19th Sep 2013
    self.window.bounds = CGRectMake(0, 20, self.window.frame.size.width, self.window.frame.size.height);
    }

方法三:

Set UIViewControllerBasedStatusBarAppearance to NO in info.plist

Pase this code in - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 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); //Added on 19th Sep 2013
NSLog(@"%f",self.window.frame.size.height);
self.window.bounds = CGRectMake(0,0, self.window.frame.size.width, self.window.frame.size.height);
}

It may push down all your views by 20 pixels.To over come that use following code in -(void)viewDidAppear:(BOOL)animated method

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
CGRect frame=self.view.frame;
if (frame.size.height==[[NSUserDefaults standardUserDefaults] floatForKey:@"windowHeight"])
{
frame.size.height-=20;
}
self.view.frame=frame;
}

You have to set windowHeight Userdefaults value after window allocation in didFinishLauncing Method like

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[[NSUserDefaults standardUserDefaults] setFloat:self.window.frame.size.height forKey:@"windowHeight"];
二  Navigation Bar重叠的问题:

在页面刚生成的时候 initWithNibName 函数 或者其他函数中加一句话: 

        if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
            self.edgesForExtendedLayout = UIRectEdgeNone;
        }
显示方式就和IOS6 一致了。 如果有什么问题,请留言。

最新文章

  1. 用java单例模式实现面板切换
  2. SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
  3. 线段覆盖4(codevs 3012)
  4. Tea---hdu5881(规律)
  5. protractor protractor.conf.js [launcher] Process exited with error code 1 undefined:1190
  6. Linux中命令行编译java接口总是提示找不到符号的疑难杂症的解决
  7. maven之pom
  8. Linux取代ifconfig指令的ip指令
  9. Linux服务器文件和windows本机文件互传方法(本地文件上传Linux,Linux文件下载到本机)
  10. 如何查看k8s存在etcd中的数据(转)
  11. 记CTC原理
  12. 该如何以正确的姿势插入SVG Sprites?
  13. BBS论坛项目
  14. Cocos2d-x开源、跨平台的游戏引擎
  15. 关于阿里云专有网络搭建FTP服务器的深坑
  16. Python mode_+
  17. mysql 全量备份与增量备份
  18. Mina 组件介绍之 IoAcceptor 与 IoConnector
  19. SQLAlchemy ORM教程之二:Query
  20. shiro配置数据库连接池总结

热门文章

  1. git fetch 和 git pull 的差别
  2. PC_excel完毕一列英文小写变大写
  3. 1064 - You have an error in your SQL syntax问题解决
  4. bootstrap模态框出现或者消失的回调函数
  5. Java学习笔记----容器
  6. 在Linux上安装zsh
  7. hdu 5256 序列变换
  8. 【bzoj4245】[ONTAK2015]OR-XOR
  9. aarch64-linux-gnu交叉编译Qt4.7.3
  10. Ubuntu 安装Consolas字体