CGRect rectStatus = [[UIApplication sharedApplication] statusBarFrame];
NSLog(@"status width - %f", rectStatus.size.width); // 宽度
NSLog(@"status height - %f", rectStatus.size.height); // 高度
// 导航栏(navigationbar)
CGRect rectNav = self.navigationController.navigationBar.frame;
NSLog(@"nav width - %f", rectNav.size.width); // 宽度
NSLog(@"nav height - %f", rectNav.size.height); // 高度
2016-12-16 15:59:25.215 AisouDemo[17748:284020] status width - 320.000000
2016-12-16 15:59:25.216 AisouDemo[17748:284020] status height - 20.000000
2016-12-16 15:59:25.216 AisouDemo[17748:284020] nav width - 320.000000
2016-12-16 15:59:25.216 AisouDemo[17748:284020] nav height - 44.000000
网友评论