Skip to content
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

Dimensions.get('window').height does not exclude the notch and home bar for iPhone X #17478

Closed
joefazz opened this issue Jan 8, 2018 · 3 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@joefazz
Copy link

joefazz commented Jan 8, 2018

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
OS: macOS High Sierra 10.13.2
Node: 8.9.1
Yarn: 1.3.2
npm: 5.6.0
Watchman: 4.7.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
react: 16.0.0 => 16.0.0
react-native: 0.50.3 => 0.50.3

Target Platform: iOS (10.3)

Steps to Reproduce

Dimensions.get('window') and Dimensions.get('screen') returns the same number on iOS which has never been an issue until the iPhone X

(Write your steps here:)

  1. Set a view to absolute and the height to Dimensions.get('window').height

Expected Behavior

I understand that it's not accounted for in the code and before this has been an android only problem but with the iPhone X, being restricted to safe area view and the dimensions extending that by x amount is causing problems with trying to scale UI elements.

It would be good if there was android behaviour where .get('screen') behaves as it does currently but .get('window') is restricted to the dimensions of the Safe Area View.

This is very easily reproducible. I would be happy to try and fix this as a PR.

@react-native-bot
Copy link
Collaborator

Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version?

I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer.

How to ContributeWhat to Expect from Maintainers

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon. labels Feb 24, 2018
@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 24, 2018
@danleveille
Copy link

@joefazz Are you still having this issue? I am still having this issue. Not sure how to account for the full area, outside of the SafeAreaView.

@rawrmaan
Copy link
Contributor

I've found this library to be helpful in accounting for the safe area when I manually calculate view heights: https://github.com/miyabi/react-native-safe-area

@facebook facebook locked as resolved and limited conversation to collaborators Feb 24, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Feb 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants