iOS StatusBar、NavigationBar、TabBar高度


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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM