Skip to content

When the app is rotated, reload the root view. #848

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

Closed
wants to merge 1 commit into from

Conversation

siuying
Copy link

@siuying siuying commented Apr 14, 2015

A simple fix to rotation issue: on rotate simply reload the root view.

Ideally it should animate the changes, but until I figure out how to do that this should do.

Fixes Workaround #813.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 14, 2015
@drkibitz
Copy link
Contributor

I appreciate this, but IMO I wouldn't call it a "fix" for #813. This behavior would not be acceptable in any app of mine. Especially wouldn't want this to be the default behavior. Another stopgap for that issue would be to set alignItems on any single line text, or explicit width if you can manage. There isn't a solution for multiline that I can find now though.

@siuying
Copy link
Author

siuying commented Apr 15, 2015

@drkibitz Agreed! The actual fix should include figure out why the label is disappearing, properly relayout the views on rotate (#809), animate them, update view controllers so that layout guide work as expected ...etc.

@ide
Copy link
Contributor

ide commented Apr 15, 2015

You probably want to layout the React views when the root view / native view controller roots are resized and I expect the end effect will look quite nice.

Agree with @drkibitz that I wouldn't want to blow away the entire app when the user rotates their device and in some ways this is similar to crashing if the user loses their state. If this behavior is ok for your app I think it'd be better to keep it in your own app's code.

@drkibitz
Copy link
Contributor

@siuying Please take a look at #857

Don't think it fixes #809, but it should fix #813

@sahrens
Copy link
Contributor

sahrens commented May 14, 2015

Yeah, this is not the right way to go. Also note that the UIExplorer app does do somewhat animated re-layout on rotation...

@sahrens sahrens closed this May 14, 2015
facebook-github-bot pushed a commit that referenced this pull request Jan 31, 2019
Summary:
Specifically, updates the UWP .vcxproj for MSBuild and also exposes the UseLegacyStretchBehaviour API for use with react-native-windows.
Pull Request resolved: facebook/yoga#848

Reviewed By: SidharthGuglani

Differential Revision: D13848609

Pulled By: davidaurelio

fbshipit-source-id: eab046ff3c47e49706f515e209d8aaf750c2198f
matt-oakes pushed a commit to matt-oakes/react-native that referenced this pull request Feb 7, 2019
Summary:
Specifically, updates the UWP .vcxproj for MSBuild and also exposes the UseLegacyStretchBehaviour API for use with react-native-windows.
Pull Request resolved: facebook/yoga#848

Reviewed By: SidharthGuglani

Differential Revision: D13848609

Pulled By: davidaurelio

fbshipit-source-id: eab046ff3c47e49706f515e209d8aaf750c2198f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants