-
Notifications
You must be signed in to change notification settings - Fork 24.7k
iOS Dimensions.get('window') doesn't exclude SafeAreas #51150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Warning Unsupported version: It looks like your issue or the example you provided uses an unsupported version of React Native. |
Warning Unsupported version: It looks like your issue or the example you provided uses an unsupported version of React Native. |
@JDMathew Thanks for raising this issue, could please verify if this is happening on latest react-native version |
"I’ve faced similar issues on iOS, and I think this is caused by the layout and style rendering in , where margin: 24 is not being counted |
@devanshsaini11, yes this is still an issue on Here is the PR with a reproducer using RNTesterPlayground to show it on the latest RN version. Initially I provided a reproducer using snack with the latest expo version as it was faster to setup. However it seems that even though the latest version of expo (52) was used, it is already an unsupported RN version ( |
Description
The values returned from the
Dimensions
API for 'window' are incorrect on iOS.iOS
Dimensions.get('window').height
is returning the height with SafeAreas and it should be without SafeAreasi.e
Dimensions.get('window').height
should return the screen height without SafeAreas whileDimensions.get('screen').height
should return the screen height with SafeAreas as is convention.This is correct on Android, and incorrect on iOS
Steps to reproduce
Run the following on an Android and an iOS device with SafeAreas. Notice that the Android values differ but the iOS values are the same.
React Native Version
0.79.0
Affected Platforms
Runtime - iOS
Output of
npx @react-native-community/cli info
Stacktrace or Logs
MANDATORY Reproducer
https://snack.expo.dev/ci1UBlgM8PsixJnwYqW1d
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: