获取状态栏高度的方法:
CGRect rectOfStatusbar = [[UIApplication sharedApplication] statusBarFrame];
NSLog(@"statusbar height: %f", rectOfStatusbar.size.height); // 高度
获取导航栏高度的方法:
CGRect rectOfNavigationbar = self.navigationController.navigationBar.frame;
NSLog(@"navigationbar height: %f", rectOfNavigationbar.size.height); // 高度
普通iphone:statusbar height = 20 navigationbar height = 44
x系列:statusbar height = 44 navigationbar height = 44