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

When rotating an app to landscape the statusbar is hidden #10751

Closed
raffij opened this issue Nov 4, 2016 · 19 comments
Closed

When rotating an app to landscape the statusbar is hidden #10751

raffij opened this issue Nov 4, 2016 · 19 comments
Labels
Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@raffij
Copy link

raffij commented Nov 4, 2016

Description

An app loaded in portrait shows the statusbar and when rotated to landscape hides the statusbar. Rotating the app back to portrait shows the statusbar again.
An app loaded in landscape shows no statusbar. When rotated to portrait still shows no statusbar.

Reproduction

react-native init ProjectName

Additional Information

  • React Native version: 0.36.1
  • Platform: iOS
  • Operating System: MacOS
@brentvatne brentvatne added the Platform: iOS iOS applications. label Nov 6, 2016
@brentvatne
Copy link
Collaborator

I also noticed this! @lacker - any idea who to assign to?

@mmmulani
Copy link
Contributor

mmmulani commented Nov 7, 2016

does this repro in the UIExplorer or did something change with our initial config settings?

@raffij
Copy link
Author

raffij commented Nov 9, 2016

@mmmulani yes. It's something wrong in core.

When the following is done it happens.

git clone https://github.com/facebook/react-native.git
cd react-native
npm install
open Examples/UIExplorer/UIExplorer.xcodeproj

@mmmulani
Copy link
Contributor

mmmulani commented Nov 9, 2016

oh in that case, do you mind running a bisect? I'm a bit swamped with other work and won't get to look at it for a couple days

@mrpp01
Copy link

mrpp01 commented Dec 4, 2016

I would like to work on this bug. Any idea on how I should approach it?

@pvinis
Copy link
Contributor

pvinis commented Dec 8, 2016

@mrpp01 just find out when this broke. do a git bisect and find out which commit broke it. that should make it easy to fix, or at least find out why.

@mrpp01
Copy link

mrpp01 commented Jan 25, 2017

@pvinis I have tried to identify a good version of react native where the error does not exist. But as far as version 0.14.2, the error still exists. I tried to test on older versions, but had not been able to make it run. I doubt that bisect would be helpful as the bug might exist since the beginning. Is there any other approaches that you think I should try?

@pvinis
Copy link
Contributor

pvinis commented Jan 29, 2017

hm.. then i guess it was not broken. just never worked.. then if you still want to try to fix it, i would suggest to take a look at the statusbar api and the rotation detection for interface and for device api from apple. and maybe you can locate some thing with those.

@outaTiME
Copy link

Same here with react-native 0.41.

The status bar disappears in landscape mode, check out the dark blue bar on top in second image:

img_0351

img_0352

@mzmiric5
Copy link

mzmiric5 commented Mar 3, 2017

Is it possible that this happens due to the fact that, since iOS8 UIViewController’s implementation of prefersStatusBarHidden returns YES when its trait collection’s horizontal size class is compact?

By default, this method returns false with one exception. For apps linked against iOS 8 or later, this method returns true if the view controller is in a vertically compact environment.

https://developer.apple.com/reference/uikit/uiviewcontroller/1621440-prefersstatusbarhidden

@ferrannp
Copy link
Contributor

ferrannp commented Apr 3, 2017

I am using 0.43.0 and this still happens.

@mzmiric5
Copy link

mzmiric5 commented Apr 4, 2017

@ferrannp not sure if this will be resolved on the react-native end, but here is a solution that you can use

In your AppDelegate.m add the following lines in your application didFinishLaunchingWithOptions

[application setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
[application setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];

and make sure that UIViewControllerBasedStatusBarAppearance is set to false in your app's Into.plist.

This will cause the status bar to be visible in landscape mode.

Hope this helps.

@ferrannp
Copy link
Contributor

ferrannp commented Apr 5, 2017

@mzmiric5 nice, this works, thank you! Although, I didn't know default behavior of iOS native apps was to hide it on landscape. I guess this could be documented somewhere if we do not want to add it to StatusBar but definitely this issue can be closed.

@hramos hramos added the Icebox label Jul 20, 2017
@hramos
Copy link
Contributor

hramos commented Jul 20, 2017

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

@hramos hramos closed this as completed Jul 20, 2017
@jdspugh
Copy link

jdspugh commented Jul 27, 2017

When rotating an app to landscape the statusbar is hidden. This is happening for me.

react-native: 0.45.1
device: iPhone5

@lihue
Copy link

lihue commented Nov 9, 2017

Please reopen this bug since it is still not solved.

react-native: 0.46.3
Device iPhone 7

@hramos
Copy link
Contributor

hramos commented Nov 13, 2017

There's been several releases since 0.46.3 was cut. If you're still seeing this in master, please open a new issue.

@rangav
Copy link

rangav commented Jan 20, 2018

This worked for me

Dimensions.addEventListener('change', () => {
     StatusBar.setHidden(false);
})

@ou2s
Copy link

ou2s commented Feb 6, 2018

I also have this bug on 0.52.1

please reopen the issue @hramos

@facebook facebook locked as resolved and limited conversation to collaborators Jul 20, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests