实现ios7与ios6界面的兼容

来源:互联网 发布:windows查找文件命令 编辑:程序博客网 时间:2024/05/16 07:48

方法1:


在每一个会上移的viewcontroller中的界面初始化函数中,添加下面一句

if ([[[UIDevicecurrentDevice] systemVersion] floatValue] >= 7) {

        self.view.bounds =CGRectMake(0, -20,self.view.frame.size.width,self.view.frame.size.height );

    }

或者在initView中,或者在initWithNibName中。


同时在appdelegate.m中设置全局的状态栏的背景颜色。


方法2:

这个方法会覆盖状态栏。

self.window = [[UIWindowalloc] initWithFrame:[[UIScreenmainScreen] bounds]];  如果是ios7,,直接在appdelegate的这句话中的起点的y加上20.


0 0
原创粉丝点击