时光

Strive to be an excellent developer

  :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

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

posted on 2015-03-04 08:44  滴滴时光  阅读(5200)  评论(0)    收藏  举报