CGFloat statusHeight = [[UIApplication sharedApplication] statusBarFrame].size. Height; NSLog(@" status bar height: %f",statusHeight); / / get the height of the navigation bar CGFloat navHeight = self. The navigationController. NavigationBar. Frame. The size, height; NSLog(@" navHeight: %f",navHeight); / / get the height of the tabBar / / 1. Used in tabBarController (VC) your inheritance from UITabBarController CGFloat tabBarHeight = self. The tabBar. Frame. The size, height;  NSLog(@"tabBar height: %f",tabBarHeight); //2. TabBarController *tabBarVC = [[UITabBarController alloc] init]; / / (here to pick up your current tabBarVC instance) CGFloat tabBarHeight = tabBarVC. The tabBar. Frame. The size, height; NSLog(@"tabBar height: %f",tabBarHeight);Copy the code
define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width) #define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height) #define mc_Is_iphone (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) #define Mc_Is_iphoneX SCREEN_WIDTH >= 375.0f&& Mc_Is_iphone /* status bar height */ #define McStatusBarHeight (CGFloat)(mc_Is_iphoneX? (44.0) : (20.0)) / * * / # define navigation bar height McNavBarHeight (44) / * the status bar and navigation total height * / # define McNavBarAndStatusBarHeight (CGFloat)(mc_Is_iphoneX? (88.0):(64.0)) /*TabBar height */ #define McTabBarHeight (CGFloat) (49.0 + 34.0):(49.0)) /* top safety area away from height */ #define McTopBarSafeHeight (CGFloat)(Mc_Is_iphoneX? (44.0):(0)) /* bottom security zone away from the height */ #define McBottomSafeHeight (CGFloat)(Mc_Is_iphoneX? */ #define McTopBarDifHeight (CGFloat)(Mc_Is_iphoneX? (24.0) : (0)) / * navigation bar and the height of the Tabbar total * / # define McNavAndTabHeight (McNavBarAndStatusBarHeight + McTabBarHeight)Copy the code