通常 状态栏+导航栏=20+44=64
iPhone X 状态栏+导航栏=44+44=88
//获取状态栏的rect
CGRect statusRect = [[UIApplication sharedApplication] statusBarFrame];
//获取导航栏的rect
CGRect navRect = self.navigationController.navigationBar.frame;
那么导航栏+状态栏的高度
statusRect.size.height+navRect.size.height
网友评论