naoufal / react-native-safari-view

A React Native wrapper for Safari View Controller.

Home Page:https://www.npmjs.com/package/react-native-safari-view

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

In landscape mode, Safari view header overlaps status bar

sachinrekhi opened this issue · comments

An iOS app can be configured to optionally maintain the status bar in landscape mode. In my app I have done so. Unfortunately now the Safari View header now overlaps the status bar when trigger in landscape mode.

See below image:
screen shot 2017-09-05 at 9 36 13 pm

I'm using react-native-safari-view 2.0.0 and react-native 0.48.0

Why not dismiss the status bar prior to showing the Safari View?

Unfortunately the only way I know how to make the status bar show up in landscape mode in React Native is by modifying the AppDelegate.m on the Objective C side, which applies to all views. So I don't know how to programmatically disable it before showing the Safari view on the JS side as you suggest.

Ideally I was hoping that the Safari view can detect a status bar is being shown and add a padding if it is.

Sounds like this is what you're looking for.

https://facebook.github.io/react-native/docs/statusbar.html

This sounds like an app specific use case and I don't think it's the Safari View's responsibility to manage the display state of the status bar.

Hm, interesting, I just tried it again and now it's showing up fine below the status bar. Seems like an intermittent issue.

screen shot 2017-09-05 at 10 28 14 pm

But thanks for the pointer on how to hide the status bar in React Native. Sounds like a decent workaround.