您的位置:首页 > 其它

计算状态栏和导航条的高度

2015-10-13 19:40 302 查看
  // 状态栏(statusbar)

    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);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: