ovr / react-native-status-bar-height

Small library that helps you to get status bar height, P.S 📱X supported ❤️
MIT License
464 stars 60 forks source link

Wrong status bar height on Pixel 6 #38

Open jzxchiang1 opened 2 years ago

jzxchiang1 commented 2 years ago

Title says it all...

andrewzey commented 2 years ago

Same here. We have customer reports of wrong status bar padding on a Pixel 5. We're not using this package, but also use StatusBar.currentHeight to get the value on Android. It appears to be a react-native problem on Pixel phones :(

jzxchiang1 commented 2 years ago

Same here. We have customer reports of wrong status bar padding on a Pixel 5. We're not using this package, but also use StatusBar.currentHeight to get the value on Android. It appears to be a react-native problem on Pixel phones :(

I spent a couple hours looking into this.

The best solution I've found is to use react-native-safe-area-context.

Then, an accurate status bar height can be retrieved from useSafeAreaInsets().top. Better than any other solution out there. In fact, it is the one recommended by Expo.