[UIApplication sharedApplication].statusBarFrame.size.height. But since all sizes are in points, not in pixels, status bar height always equals 20.

Update. Seeing this answer being considered helpful, I should elaborate.

Status bar height is, indeed, equals 20.0f points except following cases:

  • status bar has been hidden with setStatusBarHidden:withAnimation: method and its height equals 0.0f points;
  • as @Anton here pointed out, during an incoming call outside of Phone application or during sound recording session status bar height equals 40.0f points.

There's also a case of status bar affecting the height of your view. Normally, the view's height equals screen dimension for given orientation minus status bar height. However, if you animate status bar (show or hide it) after the view was shown, status bar will change its frame, but the view will not, you'll have to manually resize the view after status bar animation (or during animation since status bar height sets to final value at the start of animation).

Update 2. There's also a case of user interface orientation. Status bar does not respect the orientation value, thus status bar height value for portrait mode is [UIApplication sharedApplication].statusBarFrame.size.height (yes, default orientation is always portrait, no matter what your app info.plist says), for landscape - [UIApplication sharedApplication].statusBarFrame.size.width. To determine UI's current orientation when outside of UIViewController and self.interfaceOrientation is not available, use [UIApplication sharedApplication].statusBarOrientation.

Update for iOS7. Even though status bar visual style changed, it's still there, its frame still behaves the same. The only interesting find about status bar I got – I share: your UINavigationBar's tiled background will also be tiled to status bar, so you can achieve some interesting design effects or just color your status bar. This, too, won't affect status bar height in any way.

Answer from Kyr Dunenkoff on Stack Overflow
🌐
Kapeli
kapeli.com › cheat_sheets › iOS_Design.docset › Contents › Resources › Documents › index
iOS Design - Dash Cheat Sheets - Kapeli
January 9, 2025 - User interface design guidelines, dimensions, and best practices for iOS mobile applications.
🌐
Apple Developer
developer.apple.com › forums › thread › 662466
iOS14 statusBarHeight is not 44.0 … | Apple Developer Forums
We've always used the status bar height as the distance between the navigation bar and the very top, however we should be using the safe area's top inset. Until iOS 12, the status bar height has always matched the safe area's top inset, but now they added some padding at the bottom in certain ...
Discussions

Need to support iPhone 12 status bar height
Version Tell us which versions you are using: react-native-router-flux v4.2.0 react v16.13.1 react-native v0.63.0 Xcode 12.1 Expected behaviour All notch iPhone use 44 height before iPhone 12. On i... More on github.com
🌐 github.com
25
September 7, 2020
How to use the Status Bar height instead of the Safe Area top inset on iOS?
Expo has one for iOS and Android. Expo-Constants statusBarHeight More on reddit.com
🌐 r/reactnative
10
60
September 24, 2025
Get iOS status bar height
Need a method to get status bar height. More on github.com
🌐 github.com
1
March 2, 2021
iPhone 14 Pro floating island status bar height incorrect
The code just measures the height of the status bar and not the safe zone. on iOS the webview should be below the safe area inset. More on github.com
🌐 github.com
20
August 16, 2022
Top answer
1 of 16
516

[UIApplication sharedApplication].statusBarFrame.size.height. But since all sizes are in points, not in pixels, status bar height always equals 20.

Update. Seeing this answer being considered helpful, I should elaborate.

Status bar height is, indeed, equals 20.0f points except following cases:

  • status bar has been hidden with setStatusBarHidden:withAnimation: method and its height equals 0.0f points;
  • as @Anton here pointed out, during an incoming call outside of Phone application or during sound recording session status bar height equals 40.0f points.

There's also a case of status bar affecting the height of your view. Normally, the view's height equals screen dimension for given orientation minus status bar height. However, if you animate status bar (show or hide it) after the view was shown, status bar will change its frame, but the view will not, you'll have to manually resize the view after status bar animation (or during animation since status bar height sets to final value at the start of animation).

Update 2. There's also a case of user interface orientation. Status bar does not respect the orientation value, thus status bar height value for portrait mode is [UIApplication sharedApplication].statusBarFrame.size.height (yes, default orientation is always portrait, no matter what your app info.plist says), for landscape - [UIApplication sharedApplication].statusBarFrame.size.width. To determine UI's current orientation when outside of UIViewController and self.interfaceOrientation is not available, use [UIApplication sharedApplication].statusBarOrientation.

Update for iOS7. Even though status bar visual style changed, it's still there, its frame still behaves the same. The only interesting find about status bar I got – I share: your UINavigationBar's tiled background will also be tiled to status bar, so you can achieve some interesting design effects or just color your status bar. This, too, won't affect status bar height in any way.

2 of 16
104

Go with Martin's suggestion to the question: Get iPhone Status Bar Height.

CGFloat AACStatusBarHeight()
{
    CGSize statusBarSize = [[UIApplication sharedApplication] statusBarFrame].size;
    return MIN(statusBarSize.width, statusBarSize.height);
}

And in Swift

func statusBarHeight() -> CGFloat {
    let statusBarSize = UIApplication.shared.statusBarFrame.size
    return Swift.min(statusBarSize.width, statusBarSize.height)
}

It seems like a hack, but it's actually pretty solid. Anyway, it's the only working solution.

Old Answer

The following code, which would go in your custom subclass of UIViewController, almost worked to support landscape. But, I noticed a corner case (when rotating from right > unsupported upside-down > left) for which it didn't work (switched height & width).

BOOL isPortrait = self.interfaceOrientation == UIInterfaceOrientationPortrait;
CGSize statusBarSize = [UIApplication sharedApplication].statusBarFrame.size;
CGFloat statusBarHeight = (isPortrait ? statusBarSize.height : statusBarSize.width);
🌐
GitHub
github.com › aksonov › react-native-router-flux › issues › 3720
Need to support iPhone 12 status bar height · Issue #3720 · aksonov/react-native-router-flux
September 7, 2020 - All notch iPhone use 44 height before iPhone 12. On iPhone 12/12 Pro/12 Pro Max it's 47. On iPhone 12 mini it's 50. Status bar height became 20 on all iPhone 12 series.
Published   Nov 12, 2020
🌐
Ajith's Blog
ajith.blog › ios-design-guide
iOS design guide | Ajith's Blog
This cheat sheet is mainly an attempt ... guidelines directly from the latest(11.3.1) Xcode’s storyboard. A status bar always extends to full width of the device....
🌐
Apple Developer
developer.apple.com › design › human-interface-guidelines › ios › bars › status-bars
Status bars - Human Interface Guidelines
March 1, 2022 - A status bar appears along the upper edge of the screen and displays information about the device’s current state, like the time, cellular carrier, and battery level.
Find elsewhere
🌐
Medium
medium.com › @lucabecchetti › calculate-top-distance-status-bar-height-and-navigation-bar-height-of-uiviewcontroller-without-e4dbfe241a77
Calculate top distance (status bar height and navigation bar height) of UIViewController without use UIApplication.shared | by Luca Becchetti | Medium
September 3, 2018 - Usually when i develop iOS application, i need to calculate the top distance of UIViewController, this distance is sum of statusbar height and navigationbar height, the simple code you can use to do this is: /// Get distance from top, based on status bar and navigationpublic var topDistance : CGFloat{ get{ if self.navigationController != nil &&!self.navigationController!.navigationBar.isTranslucent{ return 0 }else{ let barHeight=self.navigationController?.navigationBar.frame.height ??
🌐
Reddit
reddit.com › r/reactnative › how to use the status bar height instead of the safe area top inset on ios?
r/reactnative on Reddit: How to use the Status Bar height instead of the Safe Area top inset on iOS?
September 24, 2025 -

Just wondering if I can use the Status Bar height from different iPhones (which tends to be around 52–54px) instead of the top inset provided by SafeAreaView (which tends to be around 60–62px).

For context, see the image attached above. I’m willing to design my project within the 54 points related to the Status Bar on this iPhone 16 Pro, but I don’t want to hardcode it since different iPhones have different sizes.

I know this sounds like it’s not important for the end result (which is true), but I come from a design background and I’m trying to get a pixel-perfect layout compared to what I usually design in Figma. I couldn’t find anything on this here or anywhere else.

What I’ve discovered is that native apps like Airbnb seem to use the Status Bar instead of the Safe Area, which is one of the reasons I want to perfect this approach.

Thanks in advance!

🌐
Apple Developer
developer.apple.com › design › human-interface-guidelines › status-bars
Status bars | Apple Developer Documentation
A status bar appears along the upper edge of the screen and displays information about the device’s current state, like the time, cellular carrier, and battery level.
🌐
Codemia
codemia.io › knowledge-hub › path › how_to_programmatically_get_ios_status_bar_height
How to programmatically get iOS status bar height
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises
🌐
GitHub
github.com › gluonhq › attach › issues › 243
Get iOS status bar height · Issue #243 · gluonhq/attach
March 2, 2021 - Need a method to get status bar height.
Published   Mar 02, 2021
🌐
Figma
figma.com › community › file › 831970552583056395 › ios-status-bar
iOS Status Bar | Figma
Contains status bars for both iPhone with and without notch and iPadsMade into component with lots of different variants. Like call toggle, WiFi, notch and different themes.The components are very easy to customize, clean, clearly labeled, and ready to be copied over to your projects.
🌐
React Native
reactnative.dev › docs › statusbar
StatusBar · React Native
2 weeks ago - Component to control the app's status bar. The status bar is the zone, typically at the top of the screen, that displays the current time, Wi-Fi and cellular network information, battery level and/or other status icons.
🌐
GitHub
github.com › apache › cordova-plugin-statusbar › issues › 243
iPhone 14 Pro floating island status bar height incorrect · Issue #243 · apache/cordova-plugin-statusbar
August 16, 2022 - Bug Report Problem iPhone 14 pro has a new status bar with the floating island. Instead of the safe inset being 47 points like with the notch based iPhones, it is now 59 points. See this detailed blog post about the new safe are with the...
Published   Sep 23, 2022