How to determine React Native statusbar height for iOS

2.7k views Asked by At

In my React Native app on iOS, I want to make a <View> that wraps the status bar. Most places say that it should be 20px in height, but on the iPhone 11, for example, it seems to be higher than that. I want a solution that fits all devices.

How should I approach this?

1

There are 1 answers

0
Porni On

You can's set the status bar height, this is something which related to the phone OS. If you would like to extend it, you can just add a View under it with the same color.

In order to solve iPhone 10 or greater issues you need to use SafeAreaView.

"The purpose of SafeAreaView is to render content within the safe area boundaries of a device. It is currently only applicable to iOS devices with iOS version 11 or later"