1群叶、先獲取狀態(tài)欄的高度
// 狀態(tài)欄(statusbar)
CGRect rectStatus = [[UIApplication sharedApplication] statusBarFrame];
NSLog(@"status width - %f", rectStatus.size.width); // 寬度
NSLog(@"status height - %f", rectStatus.size.height);? // 高度
// 導(dǎo)航欄(navigationbar)+ 狀態(tài)欄 高度的宏定義
#define Nav_Height ([[UIApplication sharedApplication] statusBarFrame].size.height + self.navigationController.navigationBar.frame.size.height)
tabBar的高度
#define TabBar_Height self.tabBarController.tabBar.frame.size.height
自定義狀態(tài)欄
UIView*statusBarView = [[UIView alloc] initWithFrame:CGRectMake(0, -20,SCREEN_WIDTH,?rectNav.size.height)];
statusBarView.backgroundColor= [UIColor redColor];
[self.navigationController.navigationBar addSubview:statusBarView];