方法1:
在每一个会上移的viewcontroller中的界面初始化函数中,添加下面一句
if ([[[UIDevice currentDevice] 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 = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 如果是ios7,,直接在appdelegate的这句话中的起点的y加上20.