Skip to content

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

@joefazz

Description

@joefazz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions