IOS7导航栏与状态栏融合适配方法之一

ios7导航栏和状态栏现在都归于导航栏,因此导航栏高度增加40px,也就变成了128px,那么就判断系统版本,具体方法:

  float version = [[[UIDevice currentDevice] systemVersion] floatValue];
    if(version>=7.0) {
               [self.navigationBar setBackgroundImage:LOADIMAGE(@"test", @"png") forBarPosition:UIBarPositionTopAttached barMetrics:UIBarMetricsDefault];
    }

其中test.png为高度为128px的图片

原文地址:https://www.cnblogs.com/bu779783251/p/3431512.html