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