StatusBarHeight = 20
NavigationBarHeight = 44
TabBarHeight = 49

UITabBarController *tabBarController = [[UITabBarController alloc] initWithNibName:nil bundle:nil];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:tabBarController];

int statusBarHeight = [[UIApplication sharedApplication] statusBarFrame].size.height; 
int tabBarHeight = tabBarController.tabBar.bounds.size.height; 
int navigationBarHeight = navigationController.navigationBar.bounds.size.height;

NSLog(@"StatusBarHeight=%d, TabBarHeight=%d, NavigationBarHeight=%d", statusBarHeight, tabBarHeight, navigationBarHeight);
// 2015-03-04 08:41:37.081 Objective-C语法[706:15003] StatusBarHeight=20, TabBarHeight=49, NavigationBarHeight=44

相关文章: