float statusBarHeight = 0;
if (@available(iOS 13.0, *)) {
UIStatusBarManager *statusBarManager = [UIApplication sharedApplication].windows.firstObject.windowScene.statusBarManager;
statusBarHeight = statusBarManager.statusBarFrame.size.height;
}
else {
statusBarHeight = [UIApplication sharedApplication].statusBarFrame.size.height;
}
NSLog(@"statusBarHeight:%f",statusBarHeight);
机型 |
描述 |
类型 |
iPhone X |
44 |
刘海屏 |
iPhone XR |
48 |
刘海屏 |
iPhone 11 |
48 |
刘海屏 |
iPhone 11 Pro |
44 |
刘海屏 |
iPhone 11 Pro Max |
44 |
刘海屏 |
iPhone 12 |
47 |
刘海屏 |
iPhone 12 mini |
50 |
刘海屏 |
iPhone 12 Pro |
47 |
刘海屏 |
iPhone 12 Pro Max |
47 |
刘海屏 |
iPhone 13 |
47 |
刘海屏 |
iPhone 13 mini |
50 |
刘海屏 |
iPhone 13 Pro |
47 |
刘海屏 |
iPhone 13 Pro Max |
47 |
刘海屏 |
iPhone 14 |
47 |
刘海屏 |
iPhone 14 Plus |
47 |
刘海屏 |
iPhone 14 Pro |
54 |
灵动岛 |
iPhone 14 Pro Max |
54 |
灵动岛 |