Skip to content
This repository has been archived by the owner on Jan 30, 2021. It is now read-only.

Doesn't work in landscape? #4

Closed
FezVrasta opened this issue Nov 28, 2017 · 9 comments
Closed

Doesn't work in landscape? #4

FezVrasta opened this issue Nov 28, 2017 · 9 comments

Comments

@FezVrasta
Copy link

It looks like this component doesn't add any padding in landscape, but this is going to allow elements to be rendered below the status bar.

Am I missing something maybe?

@davepack
Copy link
Contributor

Sometimes the measurement is inaccurate from onLayout. If you know a View is always going to touch an edge of the screen, but SafeAreaView is not adding padding automatically, use forceInset={{ [edge]: 'always' }} to force the correct padding on iPhoneX. It will automatically adjust according to orientation.

@davepack
Copy link
Contributor

Unless I misunderstood your question. Padding gets added to top and bottom edges when in portrait and left and right edges in landscape.

@FezVrasta
Copy link
Author

I was thinking that this component would have added padding also for the status bar

@davepack
Copy link
Contributor

It does add padding for the status bar. Can you share a screenshot and code that shows the problem you’re having?

@alizain-wal
Copy link

It doesn't add padding on iOS 10 and earlier.

@FezVrasta
Copy link
Author

I just add the view with inside some text and I reproduce the problem.

@davepack
Copy link
Contributor

What device is this on? Can you share a screen shot?

@cguyer
Copy link

cguyer commented Apr 23, 2018

I believe this is what he is talking about with the use of react navigation:
iPhone 5S - ios 11.3
Portrait
img_0009
Landscape
img_0010

I've been actually debugging to see if it is just a missed setting, bad code or an actual bug. In portrait there is automatic padding at top for older iphone with safeareaview but when you rotate to landscape the status bar is hidden but if you swipe down to show status bar it then displays it and the bar remains there after closing, overlapping the header (see time/battery icons in landscape image)

It may be related to facebook/react-native#18005 as the iOS status bar gets hidden by default. So if on load the iOS status is not there and no padding is added but then you swipe down for notifications, the bar is then displayed and does not go away resulting in overlap.

@brentvatne
Copy link
Member

this should be resolved in version 1.0 which was released today, thanks for reporting!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants